public void XtestInvoke() throws XBayaException {
WorkflowCreator creator = new WorkflowCreator();
Workflow workflow0 = creator.createGFacWorkflow();
WorkflowClient client = WorkflowEngineManager.getWorkflowClient();
client.setEngineURL(XBayaConstants.DEFAULT_GPEL_ENGINE_URL);
URI templateID = client.createScriptAndDeploy(workflow0, false);
// Load a workflow template from the GPEL Engine.
Workflow workflow = client.load(templateID);
// Get the metadata for input.
XmlElement inputAppinfo = workflow.getInputMetadata();
logger
.info("inputAppinfo: "
+ XMLUtil.xmlElementToString(inputAppinfo));
// Get the input information
List<WSComponentPort> inputs = workflow.getInputs();
for (WSComponentPort input : inputs) {
// Show the information of each input.
// Name
String name = input.getName();
logger.info("name: " + name);
// Type
QName type = input.getType();
logger.info("type: " + type);
// Metadata as XML
XmlElement appinfo = input.getAppinfo();
logger.info("appinfo: " + XMLUtil.xmlElementToString(appinfo));
if (appinfo != null) {
// Parse the simple case.
for (XmlElement element : appinfo.requiredElementContent()) {
String tag = element.getName();
String value = element.requiredText();
logger.info(tag + " = " + value);
}
}
// Set a value to each input.
input.setValue("200");
}
// Instantiate the workflow template.
GcInstance instance = client.instantiate(workflow, this.configuration
.getDSCURL());
// ID to retrieve the workflow instance
URI instanceID = instance.getInstanceId();
logger.info("instanceID: " + instanceID);
// Start the workflow instance.
WsdlDefinitions wsdl = client.start(instance);
// Create lead context.
LeadContextHeaderHelper leadContextHelper = new LeadContextHeaderHelper();
leadContextHelper.setXBayaConfiguration(this.configuration);
LeadContextHeader leadContext = leadContextHelper