for (WSComponentPort componentPort : inputs) {
if (null == componentPort.getValue()) {
if (null != componentPort.getDefaultValue()) {
componentPort.setValue(componentPort.getDefaultValue());
} else {
throw new XBayaRuntimeException(
"Workflow input cannot be null :"
+ componentPort.getName());
}
}
//This is a check that we do to make sure if the user didnt bother
//to parse the input to a type like a xmlElement or an array we would
// do it ourselves
if(componentPort.getValue() instanceof String){
componentPort.setValue(parseValue(componentPort, (String)componentPort.getValue()));
}
}
GsiInvoker secureInvoker = null;
secureInvoker = new GsiInvoker(credentials,
XBayaSecurity.getTrustedCertificates());
LEADWorkflowInvoker invoker = new LEADWorkflowInvoker(wsdl,
leadContext, null, secureInvoker);
invoker.setInputs(inputs);
final LEADWorkflowInvoker finalInvoker = invoker;
new Thread() {
public synchronized void run() {
boolean success;
try {
success = finalInvoker.invoke();
String result = null;
if (success) {
result = XmlConstants.BUILDER
.serializeToString(finalInvoker
.getOutputMessage());
} else {
result = XmlConstants.BUILDER
.serializeToString(finalInvoker
.getFaultMessage());
}
} catch (XBayaException e) {
ODEClient.this.throwException(e);
}
}
}.start();
} catch (Exception e) {
throw new XBayaRuntimeException(e);
}
}