use of org.apache.airavata.workflow.model.graph.system.OutputNode in project airavata by apache.
the class Workflow method getOutputs.
/**
* Returns the outputs of the workflow.
*
* @return The outputs of the workflow.
* @throws ComponentException
*/
public List<WSComponentPort> getOutputs() throws ComponentException {
List<OutputNode> nodes = GraphUtil.getNodes(this.graph, OutputNode.class);
List<WSComponentPort> ports = new ArrayList<WSComponentPort>();
for (OutputNode outputNode : nodes) {
ports.add(new WSComponentPort(outputNode.getName(), outputNode.getOutputPorts().get(0).getType(), null));
}
return ports;
}
use of org.apache.airavata.workflow.model.graph.system.OutputNode in project airavata by apache.
the class ParameterPropertyWindow method ok.
private void ok() {
String inputMetadataText = this.inputPanel.getMetadata();
XmlElement inputMetadata;
if (inputMetadataText.length() == 0) {
inputMetadata = null;
} else {
try {
inputMetadata = XMLUtil.stringToXmlElement(inputMetadataText);
} catch (RuntimeException e) {
String warning = "The input metadata is ill-formed.";
this.engine.getGUI().getErrorWindow().error(warning, e);
return;
}
}
String outputMetadataText = this.outputPanel.getMetadata();
XmlElement outputMetadata;
if (outputMetadataText.length() == 0) {
outputMetadata = null;
} else {
try {
outputMetadata = XMLUtil.stringToXmlElement(outputMetadataText);
} catch (RuntimeException e) {
String warning = "The output metadata is ill-formed.";
this.engine.getGUI().getErrorWindow().error(warning, e);
return;
}
}
// outputs, and the rest.
for (int i = 0; i < this.inputNodes.size(); i++) {
InputNode inputNode = this.inputNodes.get(i);
Collections.swap(this.nodes, i, this.nodes.indexOf(inputNode));
}
for (int i = 0; i < this.outputNodes.size(); i++) {
OutputNode outputNode = this.outputNodes.get(i);
Collections.swap(this.nodes, this.inputNodes.size() + i, this.nodes.indexOf(outputNode));
}
hide();
}
use of org.apache.airavata.workflow.model.graph.system.OutputNode in project airavata by apache.
the class BPELScript method getSpecialBlock.
/**
* @param node
* @param depth
* @param block
* It's a set so that duplicated nodes won't be added.
* @param startClass
* @param endClass
* @throws GraphException
*/
private void getSpecialBlock(Node node, int depth, Set<Node> block, Class startClass, Class endClass) throws GraphException {
List<Node> nextNodes = GraphUtil.getNextNodes(node);
for (Node nextNode : nextNodes) {
if (nextNode instanceof OutputNode) {
throw new GraphException("Nodes after " + startClass.getName() + " cannot be connected to the output without going through " + endClass.getName() + ".");
} else if (endClass.isInstance(nextNode)) {
block.add(nextNode);
if (depth == 0) {
// Stop the recursion here.
} else {
getSpecialBlock(nextNode, depth - 1, block, startClass, endClass);
}
} else if (startClass.isInstance(nextNode)) {
// handle embedded forEach
block.add(nextNode);
getSpecialBlock(nextNode, depth + 1, block, startClass, endClass);
} else {
block.add(nextNode);
getSpecialBlock(nextNode, depth, block, startClass, endClass);
}
}
}
use of org.apache.airavata.workflow.model.graph.system.OutputNode in project airavata by apache.
the class MonitorEventHandler method workflowFinished.
private void workflowFinished(Graph graph, boolean forward) {
for (OutputNode node : GraphUtil.getOutputNodes(graph)) {
if (forward) {
finishNode(node);
finishPredecessorNodes(node);
} else {
resetNode(node);
}
}
}
use of org.apache.airavata.workflow.model.graph.system.OutputNode in project airavata by apache.
the class MonitorEventHandler method getOutputNodes.
private LinkedList<OutputNode> getOutputNodes(WSGraph graph) {
List<NodeImpl> nodes = graph.getNodes();
LinkedList<OutputNode> outputNodes = new LinkedList<OutputNode>();
for (NodeImpl nodeImpl : nodes) {
if (nodeImpl instanceof OutputNode) {
outputNodes.add((OutputNode) nodeImpl);
}
}
return outputNodes;
}
Aggregations