Package org.apache.airavata.workflow.model.graph.system

Examples of org.apache.airavata.workflow.model.graph.system.EndifNode


        GpelCondition condition = new GpelCondition(this.bpelNS, booleanExpression);

        //
        // If block
        //
        EndifNode endifNode = getEndifNode(ifNode);
        GpelSequence ifSequence = createIfSequence(ifNode, endifNode, true, parentBlock);
        GpelIf gpelIf = new GpelIf(this.bpelNS, condition, ifSequence);

        //
        // Else block
        //
        GpelSequence elseSequence = createIfSequence(ifNode, endifNode, false, parentBlock);
        GpelElse gpelElse = new GpelElse(this.bpelNS, elseSequence);
        gpelIf.setElse(gpelElse);

        //
        // Create global variables for endif.
        //
        for (Port outputPort : endifNode.getOutputPorts()) {
            String variable = outputPort.getID() + OUTPUT_SUFFIX;
            GpelVariable ifVar = new GpelVariable(this.process.xml().getNamespace(), variable);
            XmlNamespace xsdNS = process.xml().lookupNamespaceByName(WSConstants.XSD_NS_URI);
            if (null != xsdNS && xsdNS.getPrefix() != null) {
                ifVar.xml().setAttributeValue("element",
View Full Code Here


    } else if (GraphSchema.NODE_TYPE_MERGE.equals(type)) {
      node = new EndForEachNode(nodeElement);
    } else if (GraphSchema.NODE_TYPE_IF.equals(type)) {
      node = new IfNode(nodeElement);
    } else if (GraphSchema.NODE_TYPE_ENDIF.equals(type)) {
      node = new EndifNode(nodeElement);
    } else if (GraphSchema.NODE_TYPE_DOWHILE.equals(type)) {
      node = new DoWhileNode(nodeElement);
    } else if (GraphSchema.NODE_TYPE_ENDDOWHILE.equals(type)) {
      node = new EndDoWhileNode(nodeElement);
    } else if (GraphSchema.NODE_TYPE_MEMO.equals(type)) {
View Full Code Here

    /**
     * @see org.apache.airavata.workflow.model.component.Component#createNode(org.apache.airavata.workflow.model.graph.Graph)
     */
    @Override
    public Node createNode(Graph graph) {
        EndifNode node = new EndifNode(graph);

        node.setName(NAME);
        node.setComponent(this);

        // Creates a unique ID for the node. This has to be after setName().
        node.createID();

        createPorts(node);

        return node;
    }
View Full Code Here

      throw new WorkFlowInterpreterException("Cannot evaluate XPath in If Condition: " + booleanExpression);
    }
  }

  private void handleEndIf(Node node) throws WorkflowException {
    EndifNode endIfNode = (EndifNode) node;
    SystemComponentInvoker invoker = new SystemComponentInvoker();

    List<DataPort> ports = endIfNode.getOutputPorts();
    for (int outputPortIndex = 0, inputPortIndex = 0; outputPortIndex < ports.size(); outputPortIndex++, inputPortIndex = inputPortIndex + 2) {

      Object inputVal = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex), this.invokerMap);

      Object inputVal2 = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex + 1), this.invokerMap);

      if ((inputVal == null && inputVal2 == null) || (inputVal != null && inputVal2 != null)) {
        throw new WorkFlowInterpreterException("EndIf gets wrong input number" + "Port:" + inputPortIndex + " and " + (inputPortIndex + 1));
      }

      Object value = inputVal != null ? inputVal : inputVal2;
      invoker.addOutput(endIfNode.getOutputPort(outputPortIndex).getID(), value);
    }

    this.invokerMap.put(node, invoker);

    node.setState(NodeExecutionState.FINISHED);
View Full Code Here

      throw new WorkFlowInterpreterException("Cannot evaluate XPath in If Condition: " + booleanExpression);
    }
  }

  private void handleEndIf(Node node) throws WorkflowException {
    EndifNode endIfNode = (EndifNode) node;
    SystemComponentInvoker invoker = new SystemComponentInvoker();

    List<DataPort> ports = endIfNode.getOutputPorts();
    for (int outputPortIndex = 0, inputPortIndex = 0; outputPortIndex < ports.size(); outputPortIndex++, inputPortIndex = inputPortIndex + 2) {

      Object inputVal = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex), this.invokerMap);

      Object inputVal2 = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex + 1), this.invokerMap);

      if ((inputVal == null && inputVal2 == null) || (inputVal != null && inputVal2 != null)) {
        throw new WorkFlowInterpreterException("EndIf gets wrong input number" + "Port:" + inputPortIndex + " and " + (inputPortIndex + 1));
      }

      Object value = inputVal != null ? inputVal : inputVal2;
      invoker.addOutput(endIfNode.getOutputPort(outputPortIndex).getID(), value);
    }

    this.invokerMap.put(node, invoker);

    NodeController.getGUI(node).setBodyColor(NodeState.FINISHED.color);
View Full Code Here

      throw new WorkFlowInterpreterException("Cannot evaluate XPath in If Condition: " + booleanExpression);
    }
  }

  private void handleEndIf(Node node) throws WorkflowException {
    EndifNode endIfNode = (EndifNode) node;
    SystemComponentInvoker invoker = new SystemComponentInvoker();

    List<DataPort> ports = endIfNode.getOutputPorts();
    for (int outputPortIndex = 0, inputPortIndex = 0; outputPortIndex < ports.size(); outputPortIndex++, inputPortIndex = inputPortIndex + 2) {

      Object inputVal = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex), this.invokerMap);

      Object inputVal2 = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex + 1), this.invokerMap);

      if ((inputVal == null && inputVal2 == null) || (inputVal != null && inputVal2 != null)) {
        throw new WorkFlowInterpreterException("EndIf gets wrong input number" + "Port:" + inputPortIndex + " and " + (inputPortIndex + 1));
      }

      Object value = inputVal != null ? inputVal : inputVal2;
      invoker.addOutput(endIfNode.getOutputPort(outputPortIndex).getID(), value);
    }

    this.invokerMap.put(node, invoker);

    node.setState(NodeExecutionState.FINISHED);
View Full Code Here

      throw new WorkFlowInterpreterException("Cannot evaluate XPath in If Condition: " + booleanExpression);
    }
  }

  private void handleEndIf(Node node) throws WorkflowException {
    EndifNode endIfNode = (EndifNode) node;
    SystemComponentInvoker invoker = new SystemComponentInvoker();

    List<DataPort> ports = endIfNode.getOutputPorts();
    for (int outputPortIndex = 0, inputPortIndex = 0; outputPortIndex < ports.size(); outputPortIndex++, inputPortIndex = inputPortIndex + 2) {

      Object inputVal = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex), this.invokerMap);

      Object inputVal2 = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex + 1), this.invokerMap);

      if ((inputVal == null && inputVal2 == null) || (inputVal != null && inputVal2 != null)) {
        throw new WorkFlowInterpreterException("EndIf gets wrong input number" + "Port:" + inputPortIndex + " and " + (inputPortIndex + 1));
      }

      Object value = inputVal != null ? inputVal : inputVal2;
      invoker.addOutput(endIfNode.getOutputPort(outputPortIndex).getID(), value);
    }

    this.invokerMap.put(node, invoker);

    node.setState(NodeExecutionState.FINISHED);
View Full Code Here

      throw new WorkFlowInterpreterException("Cannot evaluate XPath in If Condition: " + booleanExpression);
    }
  }

  private void handleEndIf(Node node) throws WorkflowException {
    EndifNode endIfNode = (EndifNode) node;
    SystemComponentInvoker invoker = new SystemComponentInvoker();

    List<DataPort> ports = endIfNode.getOutputPorts();
    for (int outputPortIndex = 0, inputPortIndex = 0; outputPortIndex < ports.size(); outputPortIndex++, inputPortIndex = inputPortIndex + 2) {

      Object inputVal = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex), this.invokerMap);

      Object inputVal2 = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex + 1), this.invokerMap);

      if ((inputVal == null && inputVal2 == null) || (inputVal != null && inputVal2 != null)) {
        throw new WorkFlowInterpreterException("EndIf gets wrong input number" + "Port:" + inputPortIndex + " and " + (inputPortIndex + 1));
      }

      Object value = inputVal != null ? inputVal : inputVal2;
      invoker.addOutput(endIfNode.getOutputPort(outputPortIndex).getID(), value);
    }

    this.invokerMap.put(node, invoker);

    NodeController.getGUI(node).setBodyColor(NodeState.FINISHED.color);
View Full Code Here

        GpelCondition condition = new GpelCondition(this.bpelNS, booleanExpression);

        //
        // If block
        //
        EndifNode endifNode = getEndifNode(ifNode);
        GpelSequence ifSequence = createIfSequence(ifNode, endifNode, true, parentBlock);
        GpelIf gpelIf = new GpelIf(this.bpelNS, condition, ifSequence);

        //
        // Else block
        //
        GpelSequence elseSequence = createIfSequence(ifNode, endifNode, false, parentBlock);
        GpelElse gpelElse = new GpelElse(this.bpelNS, elseSequence);
        gpelIf.setElse(gpelElse);

        //
        // Create global variables for endif.
        //
        for (Port outputPort : endifNode.getOutputPorts()) {
            String variable = outputPort.getID() + OUTPUT_SUFFIX;
            GpelVariable ifVar = new GpelVariable(this.process.xml().getNamespace(), variable);
            XmlNamespace xsdNS = process.xml().lookupNamespaceByName(WSConstants.XSD_NS_URI);
            if (null != xsdNS && xsdNS.getPrefix() != null) {
                ifVar.xml().setAttributeValue("element",
View Full Code Here

      throw new WorkFlowInterpreterException("Cannot evaluate XPath in If Condition: " + booleanExpression);
    }
  }

  private void handleEndIf(Node node) throws WorkflowException {
    EndifNode endIfNode = (EndifNode) node;
    SystemComponentInvoker invoker = new SystemComponentInvoker();

    List<DataPort> ports = endIfNode.getOutputPorts();
    for (int outputPortIndex = 0, inputPortIndex = 0; outputPortIndex < ports.size(); outputPortIndex++, inputPortIndex = inputPortIndex + 2) {

      Object inputVal = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex), this.invokerMap);

      Object inputVal2 = InterpreterUtil.findInputFromPort(endIfNode.getInputPort(inputPortIndex + 1), this.invokerMap);

      if ((inputVal == null && inputVal2 == null) || (inputVal != null && inputVal2 != null)) {
        throw new WorkFlowInterpreterException("EndIf gets wrong input number" + "Port:" + inputPortIndex + " and " + (inputPortIndex + 1));
      }

      Object value = inputVal != null ? inputVal : inputVal2;
      invoker.addOutput(endIfNode.getOutputPort(outputPortIndex).getID(), value);
    }

    this.invokerMap.put(node, invoker);

    node.setState(NodeExecutionState.FINISHED);
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.model.graph.system.EndifNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.