Package org.gpel.model

Examples of org.gpel.model.GpelAssignCopy


        GpelAssignCopyTo headerTo = new GpelAssignCopyTo(ns);
        headerTo.xml().setAttributeValue(PART_STR, LEAD_HEADER_STR);
        headerTo.xml().setAttributeValue(VARIABLE_STR,
            next.xml().attributeValue(INPUT_VARIABLE_STR));
        GpelAssignCopy headerCopy = new GpelAssignCopy(ns, headerFrom,
            headerTo);
        GpelAssign assign = (GpelAssign) last;
        assign.addCopy(headerCopy);

        GpelAssignCopyFrom nodeIDFrom = new GpelAssignCopyFrom(ns);
        nodeIDFrom.setLiteral(XmlConstants.BUILDER
            .parseFragmentFromString("<dummyelement>"
                + next.xml().attributeValue(NAME)
                + "</dummyelement>"));
        GpelAssignCopyTo nodeIDTo = new GpelAssignCopyTo(ns);

        nodeIDTo.xml().setAttributeValue(PART_STR, LEAD_HEADER_STR);
        nodeIDTo.xml().setAttributeValue(VARIABLE_STR,
            next.xml().attributeValue(INPUT_VARIABLE_STR));
        // TODO is this ok?? what of the query language
        nodeIDTo.setQuery("/leadcntx:workflow-node-id");

        GpelAssignCopy nodeIDCopy = new GpelAssignCopy(ns, nodeIDFrom,
            nodeIDTo);
        nodeIDCopy.xml().setAttributeValue(KEEP_SRC_ELEMENT_NAME_STR, NO_STR);
        assign.addCopy(nodeIDCopy);

        GpelAssignCopyFrom timeStepFrom = new GpelAssignCopyFrom(ns);
        timeStepFrom.setLiteral(XmlConstants.BUILDER
            .parseFragmentFromString("<dummyelement>"
                + "5"
                + "</dummyelement>"));
        GpelAssignCopyTo timeStepTo = new GpelAssignCopyTo(ns);
        timeStepTo.xml().setAttributeValue(PART_STR, LEAD_HEADER_STR);
        timeStepTo.xml().setAttributeValue(VARIABLE_STR,
            next.xml().attributeValue(INPUT_VARIABLE_STR));
        // TODO is this ok?? what of the query language
        timeStepTo.setQuery("/leadcntx:workflow-time-step");

        GpelAssignCopy timeStepCopy = new GpelAssignCopy(ns,
            timeStepFrom, timeStepTo);
        timeStepCopy.xml()
            .setAttributeValue(KEEP_SRC_ELEMENT_NAME_STR, NO_STR);
        assign.addCopy(timeStepCopy);

      }
      last = next;
View Full Code Here


        findReplaceAssign(next);
      }else if(isAssign(next)){
        GpelAssign assign = (GpelAssign)next;
        Iterator<GpelAssignCopy> itr = assign.copyOperations().iterator();
        while(itr.hasNext()){
          GpelAssignCopy copy = itr.next();
          String query = copy.getFrom().xml().attributeValue(QUERY_STR);
          if(query != null){         
            copy.getFrom().xml().addElement(copy.getFrom().xml().getNamespace(), QUERY_STR).addChild("<![CDATA["+query+"]]>");
          }
            query = copy.getTo().xml().attributeValue(QUERY_STR);
          if(query != null){ 
            copy.getTo().xml().addElement(copy.getFrom().xml().getNamespace(), QUERY_STR).addChild("<![CDATA["+query+"]]>");
          }
        }
      }
    }
  }
View Full Code Here

        formatXpathFromValueCopy(next);
      }else if(isAssign(next)){
        GpelAssign assign = (GpelAssign)next;
        Iterator<GpelAssignCopy> itr = assign.copyOperations().iterator();
        while(itr.hasNext()){
          GpelAssignCopy copy = itr.next();
          String query = copy.getFrom().xml().attributeValue(QUERY_STR);
          XmlElement copyElmt = copy.getFrom().xml();
          //remove if attribute is found earlier
          if( null != query){
            copyElmt.removeAttribute(copyElmt.attribute(QUERY_STR));
            copyElmt.setAttributeValue(QUERY_STR, "/"+extractDataType(query));
          }
         
         
          query = copy.getTo().xml().attributeValue(QUERY_STR);
          XmlElement toElmt = copy.getTo().xml();
          //remove if attribute is found earlier
          if( null != query){
            toElmt.removeAttribute(toElmt.attribute(QUERY_STR));
            toElmt.setAttributeValue(QUERY_STR, "/"+extractDataType(query));
          }
View Full Code Here

              WsdlPortTypeOperation wsdlOperation = portType.getOperation(operation);
              WsdlMessagePart part  = wsdl.getMessage(wsdlOperation.getInput().getMessage().getLocalPart()).parts().iterator().next();
              XmlElement childElement = container.addElement(part.getElement().getLocalPart());
              Iterator<GpelAssignCopy> copyItr = assign.copyOperations().iterator();
              while(copyItr.hasNext()){
                GpelAssignCopy copyItm = copyItr.next();
                childElement.addElement(getElementName(copyItm.getTo().getQuery()));
                if(messagePartName == null){
                  messagePartName = copyItm.getTo().xml().attributeValue(PART_STR);
                }
              }
              break;
            }
          }
        }else {
          //reply
         
         
            WsdlPortType portType = workflowWSDL.getPortType(portTypeName);
            if( null != portType){
              WsdlPortTypeOperation wsdlOperation = portType.getOperation(operation);
              WsdlMessagePart part  = workflowWSDL.getMessage(wsdlOperation.getOutput().getMessage().getLocalPart()).parts().iterator().next();
              XmlElement childElement = container.addElement(part.getElement().getLocalPart());
              Iterator<GpelAssignCopy> copyItr = assign.copyOperations().iterator();
              while(copyItr.hasNext()){
                GpelAssignCopy copyItm = copyItr.next();
                childElement.addElement(getElementName(copyItm.getTo().getQuery()));
                if(messagePartName == null){
                  messagePartName = copyItm.getTo().xml().attributeValue(PART_STR);
                }
              }
          }
        }
       

        GpelAssignCopyFrom from = new GpelAssignCopyFrom(ns);
        from.setLiteral(container);
       
        GpelAssignCopyTo to = new GpelAssignCopyTo(ns);
        to.xml().setAttributeValue(PART_STR, messagePartName);
        if(isInvoke(next)){
          to.xml().setAttributeValue(VARIABLE_STR, next.xml().attributeValue(INPUT_VARIABLE_STR));
        }else{
          to.xml().setAttributeValue(VARIABLE_STR, next.xml().attributeValue(VARIABLE_STR));
        }
        GpelAssignCopy newAssign = new GpelAssignCopy(ns, from, to);
        newAssign.xml().setAttributeValue(VALIDATE_STR, NO_STR);
        GpelAssign gpelAssign = new GpelAssign(ns, newAssign);
        list.add(gpelAssign);
       
      }
      last = next;
View Full Code Here

        for (OutputNode outputNode : outputNodes) {
            Port port = outputNode.getPort();
            GpelAssignCopyFrom from = createAssignCopyFrom(port);
            GpelAssignCopyTo to = createAssignCopyTo(port, false);

            copies.add(new GpelAssignCopy(this.bpelNS, from, to));
        }

        if (copies.size() != 0) {
            // When there is no outputs, we don't create assign.
            GpelAssign assign = new GpelAssign(this.bpelNS, copies);
View Full Code Here

                continue;
            }
            GpelAssignCopyFrom from = createAssignCopyFrom(port);
            GpelAssignCopyTo to = createAssignCopyTo(port, true);

            GpelAssignCopy copy = new GpelAssignCopy(this.bpelNS, from, to);
            copies.add(copy);
        }

        GpelAssign assign = new GpelAssign(this.bpelNS, copies);
        sequence.addActivity(assign);
View Full Code Here

        // Extract array from the previous node.
        GpelAssignCopyFrom arrayFrom = createAssignCopyFrom(splitNode.getInputPort(0));
        GpelAssignCopyTo arrayTo = new GpelAssignCopyTo(this.bpelNS);
        arrayTo.setVariable(arrayName);
        GpelAssignCopy arrayCopy = new GpelAssignCopy(this.bpelNS, arrayFrom, arrayTo);
        GpelAssign arrayAssign = new GpelAssign(this.bpelNS, arrayCopy);
        sequence.addActivity(arrayAssign);

        // Extract a item from array
        String valueName = splitNode.getID() + FOREACH_VALUE_SUFFIX;
        // TODO set local variable in scope instead of process
        // TODO This should be type instead of messageType
        this.process.addMessageVariable(valueName, WSConstants.XSD_NS, WSConstants.XSD_ANY_TYPE.getLocalPart());
        GpelAssignCopyFrom valueFrom = new GpelAssignCopyFrom(this.bpelNS);
        valueFrom.setVariable(arrayName);
        valueFrom.setQuery("$" + arrayName + "/*[$i]");
        GpelAssignCopyTo valueTo = new GpelAssignCopyTo(this.bpelNS);
        valueTo.setVariable(valueName);
        GpelAssignCopy valueCopy = new GpelAssignCopy(this.bpelNS, valueFrom, valueTo);
        GpelAssign valueAssign = new GpelAssign(this.bpelNS, valueCopy);

        subSequence.addActivity(valueAssign);

        addBlock(forEachBlock, subSequence);

        Node mergeNode = getMergeNode(splitNode);
        String outputName = mergeNode.getID() + ARRAY_SUFIX;
        // TODO This should be type instead of messageType
        this.process.addMessageVariable(outputName, WSConstants.XSD_NS, WSConstants.XSD_ANY_TYPE.getLocalPart());
        GpelAssignCopyFrom outputFrom = createAssignCopyFrom(mergeNode.getInputPort(0).getFromPort());
        GpelAssignCopyTo outputTo = new GpelAssignCopyTo(this.bpelNS);
        outputTo.setVariable(outputName);
        outputTo.setQuery("/value[$i]");
        GpelAssignCopy outputCopy = new GpelAssignCopy(this.bpelNS, outputFrom, outputTo);
        GpelAssign outputAssign = new GpelAssign(this.bpelNS, outputCopy);
        subSequence.addActivity(outputAssign);

        GpelForEach forEach = new GpelForEach(this.bpelNS, "i", "1", "count($" + arrayName + "/*)",
                true /* parallel */, scope);
View Full Code Here

                this.process.getVariables().addVariable(ifVar);

                GpelAssignCopyFrom from = createAssignCopyFrom(fromPort);
                GpelAssignCopyTo to = new GpelAssignCopyTo(this.bpelNS);
                to.setVariable(variableName);
                GpelAssignCopy copy = new GpelAssignCopy(this.bpelNS, from, to);
                copies.add(copy);

                booleanExpression = booleanExpression.replaceAll("\\$" + i, "\\$" + variableName);
            }
        }
View Full Code Here

            DataPort inputPort = endifNode.getInputPort(index);
            Port fromPort = inputPort.getFromPort();
            GpelAssignCopyFrom from = createAssignCopyFrom(fromPort);
            GpelAssignCopyTo to = new GpelAssignCopyTo(this.bpelNS);
            to.setVariable(variable);
            GpelAssignCopy copy = new GpelAssignCopy(this.bpelNS, from, to);
            copies.add(copy);
        }
        GpelAssign assign = new GpelAssign(this.bpelNS, copies);
        sequence.addActivity(assign);
View Full Code Here

            DataPort inputPort = endBlockNode.getInputPort(index);
            Port fromPort = inputPort.getFromPort();
            GpelAssignCopyFrom from = createAssignCopyFrom(fromPort);
            GpelAssignCopyTo to = new GpelAssignCopyTo(this.bpelNS);
            to.setVariable(variable);
            GpelAssignCopy copy = new GpelAssignCopy(this.bpelNS, from, to);
            copies.add(copy);
        }
        GpelAssign assign = new GpelAssign(this.bpelNS, copies);
        sequence.addActivity(assign);
View Full Code Here

TOP

Related Classes of org.gpel.model.GpelAssignCopy

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.