Package org.apache.airavata.xbaya.graph.system

Examples of org.apache.airavata.xbaya.graph.system.EndifNode


    /**
     * @see org.apache.airavata.xbaya.component.Component#createNode(org.apache.airavata.xbaya.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


        } 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_MEMO.equals(type)) {
            node = new MemoNode(nodeElement);
        } else if (GraphSchema.NODE_TYPE_RECEIVE.equals(type)) {
            node = new ReceiveNode(nodeElement);
        } else if (GraphSchema.NODE_TYPE_BLOCK.equals(type)) {
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

              + booleanExpression);
    }
  }

  private void handleEndIf(Node node) throws XBayaException {
    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);
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.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.