getBatchStatusCode
getBatchStatusCode()
Die getBatchStatusCode-Methode gibt den höchsten Statuscode aus dem Array von Befehlen zurück, die die executeBatch-Methode ausgeführt hat.
Rückgabewert
Die getBatchStatusCode-Methode gibt eine Ganzzahl zurück.
*
*
*
Beispiel
Das folgende Codebeispiel zeigt ein Beispiel zum Abrufen von BatchStatusCode.
// Top level status code is a short cut to determine if there are any 
// non-successes in the array of Response objects
if(batchResponse.getBatchStatusCode() == Response.STATUS_SUCCESS)
{
System.out.println("ExecuteBatch ran perfectly!");
}
else if(batchResponse.getBatchStatusCode() == Response.STATUS_WARNING)
{
System.out.println("ExecuteBatch call processed with at least one warning");
}
else
{
System.out.println("ExecuteBatch call processed with at least one error");
}

// Iterate through the array, and print out the message for any non-successes
for(Response response : batchResponse.getResponses())
{
if(response.getStatusCode()!=Response.STATUS_SUCCESS)
{
printDetailMessageOfWarningOrError("executeBatchCommand",
response.getAdvisoryMessages());
}
}