* @see org.apache.airavata.xbaya.invoker.WorkflowInvoker#invoke()
*/
public synchronized boolean invoke() throws WorkflowException {
try {
WSIFMessage inputMessage = super.getInputs();
logger.info("inputMessage: " + XMLUtil.xmlElementToString((XmlElement) inputMessage));
this.notifier.invokingService(inputMessage);
ExecutorService executor = Executors.newSingleThreadExecutor();
this.result = executor.submit(new Callable<Boolean>() {
@SuppressWarnings("boxing")
public Boolean call() {
try {
boolean success = WorkflowInvokerWrapperForGFacInvoker.super.invoke();
if (success) {
// Send notification
WSIFMessage outputMessage = WorkflowInvokerWrapperForGFacInvoker.super.getOutputs();
// An implementation of WSIFMessage,
// WSIFMessageElement, implements toString(), which
// serialize the message XML.
logger.info("outputMessage: " + outputMessage);
WorkflowInvokerWrapperForGFacInvoker.this.notifier.serviceFinished(outputMessage);
} else {
WSIFMessage faultMessage = WorkflowInvokerWrapperForGFacInvoker.super.getFault();
// An implementation of WSIFMessage,
// WSIFMessageElement, implements toString(), which
// serialize the message XML.
logger.info("received fault: " + faultMessage);
WorkflowInvokerWrapperForGFacInvoker.this.notifier.receivedFault(faultMessage);