LeadResourceMapping resourceMapping) {
MonitorConfiguration monitorConfiguration = this.engine.getMonitor().getConfiguration();
XBayaConfiguration configuration = this.engine.getConfiguration();
// Create the invoker
LEADWorkflowInvoker invoker = null;
try {
WsdlDefinitions wsdl = workflow.getOdeInvokableWSDL(configuration.getDSCURL(), configuration.getODEURL());
LeadContextHeader leadContext = XBayaUtil.buildLeadContextHeader(this.engine, monitorConfiguration,
StringUtil.convertToJavaIdentifier(engine.getGUI().getWorkflow().getName()), resourceMapping);
// /////////////////////////////////////
leadContext.setExperimentId(monitorConfiguration.getTopic());
// ////////////////////////////////////////////////////////////
URI messageBoxURL = null;
if (monitorConfiguration.isPullMode()) {
messageBoxURL = monitorConfiguration.getMessageBoxURL();
}
// create an invoker with LEAD Context
GsiInvoker secureInvoker = null;
if (this.engine.getWorkflowClient().isSecure()) {
MyProxyClient myProxyClient = this.engine.getMyProxyClient();
secureInvoker = new GsiInvoker(myProxyClient.getProxy(), XBayaSecurity.getTrustedCertificates());
leadContext.setScmsUrl(URI.create("https://tyr12.cs.indiana.edu:60443/SCMS?wsdl"));
}
invoker = new LEADWorkflowInvoker(wsdl, leadContext, messageBoxURL, secureInvoker);
} catch (ComponentException e) {
if (this.canceled) {
logger.error(e.getMessage(), e);
} else {
this.engine.getGUI().getErrorWindow().error(ErrorMessages.GRAPH_NOT_READY_ERROR, e);
this.invokingDialog.hide();
}
return;
} catch (RuntimeException e) {
if (this.canceled) {
logger.error(e.getMessage(), e);
} else {
this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
this.invokingDialog.hide();
}
return;
} catch (Exception e) {
this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
this.invokingDialog.hide();
return;
}
invoker.setInputs(inputs);
// Start the monitor.
try {
this.engine.getMonitor().start();
} catch (MonitorException e) {
if (this.canceled) {
logger.error(e.getMessage(), e);
} else {
this.engine.getGUI().getErrorWindow().error(ErrorMessages.MONITOR_SUBSCRIPTION_ERROR, e);
this.invokingDialog.hide();
}
return;
} catch (RuntimeException e) {
if (this.canceled) {
logger.error(e.getMessage(), e);
} else {
this.engine.getGUI().getErrorWindow().error(ErrorMessages.MONITOR_SUBSCRIPTION_ERROR, e);
this.invokingDialog.hide();
}
return;
} catch (Error e) {
this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
this.invokingDialog.hide();
}
final LEADWorkflowInvoker workflowInvoker = invoker;
new Thread() {
@Override
public synchronized void run() {
try {
boolean success = workflowInvoker.invoke();
String result = null;
if (success) {
result = XmlConstants.BUILDER.serializeToString(workflowInvoker.getOutputMessage());
} else {
result = XmlConstants.BUILDER.serializeToString(workflowInvoker.getFaultMessage());
}
logger.info("Done with the execution. result: " + result);
} catch (WorkflowException e) {
ODEInvoker.this.engine.getGUI().getErrorWindow().error(ErrorMessages.UNEXPECTED_ERROR, e);
}