//TODO publish the status messages to the message bus
while ((factory.getActivityStatus(activityEpr) != ActivityStateEnumeration.FINISHED) &&
(factory.getActivityStatus(activityEpr) != ActivityStateEnumeration.FAILED)){
ActivityStatusType activityStatus = null;
try {
activityStatus = getStatus(factory, activityEpr);
log.info (subStatusAsString(activityStatus));
} catch (UnknownActivityIdentifierFault e) {
throw new GFacProviderException(e.getMessage(), e.getCause());
}
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
continue;
}
ActivityStatusType activityStatus = null;
try {
activityStatus = getStatus(factory, activityEpr);
} catch (UnknownActivityIdentifierFault e) {
throw new GFacProviderException(e.getMessage(), e.getCause());
}
log.info(formatStatusMessage(activityEpr.getAddress().getStringValue(), activityStatus.getState().toString()));
if ((activityStatus.getState() == ActivityStateEnumeration.FAILED)) {
log.info(activityStatus.getFault().getFaultcode().getLocalPart()
+ "\n" + activityStatus.getFault().getFaultstring());
log.info("EXITCODE: "+activityStatus.getExitCode());
}
}