WSGraph graph = workflow.getGraph();
String adder1ID = "Adder_add";
String adder2ID = "Adder_add_2";
NodeImpl a = graph.getNode("a");
NodeImpl b = graph.getNode("b");
NodeImpl c = graph.getNode("c");
NodeImpl d = graph.getNode("d");
NodeImpl adder = graph.getNode(adder1ID);
NodeImpl adder2 = graph.getNode(adder2ID);
WsdlDefinitions workflowWSDL = workflow.getWorkflowWSDL();
DSCUtil.convertToCWSDL(workflowWSDL, URI.create("http://example.com"));
HashMap<String, String> inputMap = new HashMap<String, String>();
inputMap.put("a", "2");
inputMap.put("b", "3");
inputMap.put("c", "4");
inputMap.put("d", "5");
try {
sendNotification(workflowWSDL, null, WSDLUtil.getFirstOperation(workflowWSDL).getName(), inputMap, null,
notifier);
} catch (UtilsException e) {
e.printStackTrace();
}
WsdlDefinitions adderWSDL = WsdlResolver.getInstance().loadWsdl(
new File(XBayaPathConstants.WSDL_DIRECTORY + File.separator + Adder.WSDL_PATH).toURI());
HashMap<String, String> inputMap1 = new HashMap<String, String>();
inputMap1.put("x", "2");
inputMap1.put("y", "3");
HashMap<String, String> outputMap1 = new HashMap<String, String>();
outputMap1.put("z", "5");
sendNotification(adderWSDL, adder1ID, "add", inputMap1, outputMap1, notifier);
// These are needed because without GUI, the nodes' color won't be
// changed.
a.setState(NodeExecutionState.FINISHED);
b.setState(NodeExecutionState.FINISHED);
adder.setState(NodeExecutionState.FINISHED);
repaintAndWait(3);
HashMap<String, String> inputMap2 = new HashMap<String, String>();
inputMap2.put("x", "4");
inputMap2.put("y", "5");
HashMap<String, String> outputMap2 = new HashMap<String, String>();
outputMap2.put("z", "9");
sendNotification(adderWSDL, adder2ID, "add", inputMap2, outputMap2, notifier);
c.setState(NodeExecutionState.FINISHED);
d.setState(NodeExecutionState.FINISHED);
adder2.setState(NodeExecutionState.FINISHED);
repaintAndWait(3);
}