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");
sendNotification(workflowWSDL, null,
WSDLUtil.getFirstOperation(workflowWSDL).getName(), inputMap, null, notifier);
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.getGUI().setBodyColor(NodeState.FINISHED.color);
b.getGUI().setBodyColor(NodeState.FINISHED.color);
adder.getGUI().setBodyColor(NodeState.FINISHED.color);
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.getGUI().setBodyColor(NodeState.FINISHED.color);
d.getGUI().setBodyColor(NodeState.FINISHED.color);
adder2.getGUI().setBodyColor(NodeState.FINISHED.color);
repaintAndWait(3);
}