// Use topic as a base of workflow instance ID so that the monitor can
// find it.
URI workfowInstanceID = URI.create(StringUtil.convertToJavaIdentifier(topic));
this.workflow.setGPELInstanceID(workfowInstanceID);
MonitorConfiguration notifConfig = this.engine.getMonitor().getConfiguration();
notifConfig.setTopic(topic);
arguments.add("-" + JythonScript.TOPIC_VARIABLE);
arguments.add(topic);
Collection<WSNode> wsNodes = GraphUtil.getWSNodes(this.engine.getGUI().getWorkflow().getGraph());
// This is to enable service interaction with the back end
if (this.interactChkBox.isSelected()) {
LinkedList<String> nodeIDs = new LinkedList<String>();
for (WSNode node : wsNodes) {
nodeIDs.add(node.getID());
((WSNodeGUI) NodeController.getGUI(node)).setInteractiveMode(true);
}
notifConfig.setInteractiveNodeIDs(nodeIDs);
} else {
for (WSNode node : wsNodes) {
((WSNodeGUI) NodeController.getGUI(node)).setInteractiveMode(false);
}
}
final boolean isRunCrossProduct=chkRunWithCrossProduct.isSelected();
// TODO error check for user inputs
final List<InputNode> inputNodes = GraphUtil.getInputNodes(this.workflow.getGraph());
builder.newFragment("inputs");
new ODEClient();
for (int i = 0; i < inputNodes.size(); i++) {
InputNode inputNode = inputNodes.get(i);
XBayaTextField parameterTextField = this.parameterTextFields.get(i);
inputNode.getID();
String value = parameterTextField.getText();
inputNode.setDefaultValue(value);
}
// final String gFacUrl = ((URI) this.gfacUrlListField.getSelectedItem()).toASCIIString();
// if (null != gFacUrl && !"".equals(gFacUrl)) {
// try {
// this.engine.getConfiguration().setGFacURL(new URI(gFacUrl));
// } catch (URISyntaxException e) {
// this.engine.getGUI().getErrorWindow().error(e);
// }
// }
this.engine.getConfiguration().setTopic(topic);
/*
* Load host description from xregistry and add to interpreter
*/
LeadResourceMapping mapping = null;
final LeadResourceMapping resourceMapping = mapping;
final String topicString = topic;
new Thread() {
/**
* @see java.lang.Thread#run()
*/
@Override
public void run() {
XBayaConfiguration conf = DynamicWorkflowRunnerWindow.this.engine.getConfiguration();
WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(engine.getGUI().getWorkflow(),topicString,conf.getMessageBoxURL(), conf.getBrokerURL(), conf.getAiravataAPI(), conf, DynamicWorkflowRunnerWindow.this.engine.getGUI(), DynamicWorkflowRunnerWindow.this.engine.getMonitor());
workflowInterpreterConfiguration.setRunWithCrossProduct(isRunCrossProduct);
WorkflowInterpreter workflowInterpreter = new WorkflowInterpreter(
workflowInterpreterConfiguration, new GUIWorkflowInterpreterInteractorImpl(engine, engine.getGUI().getWorkflow()));
DynamicWorkflowRunnerWindow.this.engine.registerWorkflowInterpreter(workflowInterpreter);
try {
MonitorConfiguration notifConfig = DynamicWorkflowRunnerWindow.this.engine.getMonitor()
.getConfiguration();
notifConfig.setTopic(topicString);
DynamicWorkflowRunnerWindow.this.engine.getMonitor().start();
if (resourceMapping != null)
workflowInterpreter.setResourceMapping(resourceMapping);