Package org.gpel.model

Examples of org.gpel.model.GpelVariable


      GpelVariablesContainer variables = gpelProcess.getVariables();
      for (GpelInvoke gpelInvoke : invokeList) {
        String variable = gpelInvoke.getInputVariableName();
        String opName = gpelInvoke.getOperationNcName();
        QName portType = gpelInvoke.getPortTypeQName();
        GpelVariable gpelVar = findVariable(variables, variable);
        QName messageQname = findMessage(gpelProcess, portType, opName, true, wsdls);
        String nsPrefix = findNamespacePrefix(gpelProcess, messageQname);
        gpelVar.setMessageTypeQName(new QName(messageQname.getNamespaceURI(), messageQname.getLocalPart(), nsPrefix));
       
        variable = gpelInvoke.gelOutputVariableName();
        gpelVar = findVariable(variables, variable);
        messageQname = findMessage(gpelProcess, portType, opName, false, wsdls);
        nsPrefix = findNamespacePrefix(gpelProcess, messageQname);
        gpelVar.setMessageTypeQName(new QName(messageQname.getNamespaceURI(), messageQname.getLocalPart(), nsPrefix));
      }
     

    }
  }
View Full Code Here


  private GpelVariable findVariable(GpelVariablesContainer variables, String variable) {
    Iterator<GpelVariable> iterator = variables.variables().iterator();
   
    while (iterator.hasNext()) {
      GpelVariable gpelVariable = iterator.next();
      if(variable.equals(gpelVariable.getName())){
        return gpelVariable;
      }
    }
    throw new XBayaRuntimeException("Unable to fine the variable :"+variable+ "  in the BPEL variables "+variables);
  }
View Full Code Here

   */
  public void addreceive(GpelProcess process, WsdlDefinitions workflowWsdl, String operationName, String receiveMessage ) throws CloneNotSupportedException {

    GpelVariablesContainer variables = process.getVariables();
    XmlNamespace ns = variables.xml().getNamespace();
    GpelVariable var = new GpelVariable(ns, "newReceiveVar");
    variables.addVariable(var);
    var.setMessageTypeQName(new QName(workflowWsdl.getTargetNamespace(),
        receiveMessage));

    XmlElement topSeq = process.getActivity().xml();
    Iterator iterator = topSeq.children().iterator();
    int count = 0;
View Full Code Here

            Port port = inputPorts.get(i);
            Port fromPort = port.getFromPort();
            if (fromPort != null) {
                String variableName = port.getID() + INPUT_SUFFIX;

                GpelVariable ifVar = new GpelVariable(this.process.xml().getNamespace(), variableName);
                XmlNamespace xsdNS = process.xml().lookupNamespaceByName(WSConstants.XSD_NS_URI);
                if (null != xsdNS && xsdNS.getPrefix() != null) {
                    ifVar.xml().setAttributeValue("element",
                            xsdNS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
                } else {
                    this.process.xml().declareNamespace(WSConstants.XSD_NS);
                    ifVar.xml().setAttributeValue("element",
                            WSConstants.XSD_NS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
                }
                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);
            }
        }
        if (copies.size() > 0) {
            GpelAssign assign = new GpelAssign(this.bpelNS, copies);
            sequence.addActivity(assign);
        }
        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",
                        xsdNS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
            } else {
                this.process.xml().declareNamespace(WSConstants.XSD_NS);
                ifVar.xml().setAttributeValue("element",
                        WSConstants.XSD_NS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
            }
            this.process.getVariables().addVariable(ifVar);
        }
View Full Code Here

            GpelVariablesContainer variables = gpelProcess.getVariables();
            for (GpelInvoke gpelInvoke : invokeList) {
                String variable = gpelInvoke.getInputVariableName();
                String opName = gpelInvoke.getOperationNcName();
                QName portType = gpelInvoke.getPortTypeQName();
                GpelVariable gpelVar = findVariable(variables, variable);
                QName messageQname = findMessage(gpelProcess, portType, opName, true, wsdls);
                String nsPrefix = findNamespacePrefix(gpelProcess, messageQname);
                gpelVar.setMessageTypeQName(new QName(messageQname.getNamespaceURI(), messageQname.getLocalPart(),
                        nsPrefix));

                variable = gpelInvoke.gelOutputVariableName();
                gpelVar = findVariable(variables, variable);
                messageQname = findMessage(gpelProcess, portType, opName, false, wsdls);
                nsPrefix = findNamespacePrefix(gpelProcess, messageQname);
                gpelVar.setMessageTypeQName(new QName(messageQname.getNamespaceURI(), messageQname.getLocalPart(),
                        nsPrefix));
            }

        }
    }
View Full Code Here

    private GpelVariable findVariable(GpelVariablesContainer variables, String variable) {
        Iterator<GpelVariable> iterator = variables.variables().iterator();

        while (iterator.hasNext()) {
            GpelVariable gpelVariable = iterator.next();
            if (variable.equals(gpelVariable.getName())) {
                return gpelVariable;
            }
        }
        throw new WorkflowRuntimeException("Unable to fine the variable :" + variable + "  in the BPEL variables "
                + variables);
View Full Code Here

            Port port = inputPorts.get(i);
            Port fromPort = port.getFromPort();
            if (fromPort != null) {
                String variableName = port.getID() + INPUT_SUFFIX;

                GpelVariable ifVar = new GpelVariable(this.process.xml().getNamespace(), variableName);
                XmlNamespace xsdNS = process.xml().lookupNamespaceByName(WSConstants.XSD_NS_URI);
                if (null != xsdNS && xsdNS.getPrefix() != null) {
                    ifVar.xml().setAttributeValue("element",
                            xsdNS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
                } else {
                    this.process.xml().declareNamespace(WSConstants.XSD_NS);
                    ifVar.xml().setAttributeValue("element",
                            WSConstants.XSD_NS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
                }
                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);
            }
        }
        if (copies.size() > 0) {
            GpelAssign assign = new GpelAssign(this.bpelNS, copies);
            sequence.addActivity(assign);
        }
        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",
                        xsdNS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
            } else {
                this.process.xml().declareNamespace(WSConstants.XSD_NS);
                ifVar.xml().setAttributeValue("element",
                        WSConstants.XSD_NS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
            }
            this.process.getVariables().addVariable(ifVar);
        }
View Full Code Here

            GpelVariablesContainer variables = gpelProcess.getVariables();
            for (GpelInvoke gpelInvoke : invokeList) {
                String variable = gpelInvoke.getInputVariableName();
                String opName = gpelInvoke.getOperationNcName();
                QName portType = gpelInvoke.getPortTypeQName();
                GpelVariable gpelVar = findVariable(variables, variable);
                QName messageQname = findMessage(gpelProcess, portType, opName, true, wsdls);
                String nsPrefix = findNamespacePrefix(gpelProcess, messageQname);
                gpelVar.setMessageTypeQName(new QName(messageQname.getNamespaceURI(), messageQname.getLocalPart(),
                        nsPrefix));

                variable = gpelInvoke.gelOutputVariableName();
                gpelVar = findVariable(variables, variable);
                messageQname = findMessage(gpelProcess, portType, opName, false, wsdls);
                nsPrefix = findNamespacePrefix(gpelProcess, messageQname);
                gpelVar.setMessageTypeQName(new QName(messageQname.getNamespaceURI(), messageQname.getLocalPart(),
                        nsPrefix));
            }

        }
    }
View Full Code Here

    private GpelVariable findVariable(GpelVariablesContainer variables, String variable) {
        Iterator<GpelVariable> iterator = variables.variables().iterator();

        while (iterator.hasNext()) {
            GpelVariable gpelVariable = iterator.next();
            if (variable.equals(gpelVariable.getName())) {
                return gpelVariable;
            }
        }
        throw new XBayaRuntimeException("Unable to fine the variable :" + variable + "  in the BPEL variables "
                + variables);
View Full Code Here

            Port port = inputPorts.get(i);
            Port fromPort = port.getFromPort();
            if (fromPort != null) {
                String variableName = port.getID() + INPUT_SUFFIX;

                GpelVariable ifVar = new GpelVariable(this.process.xml().getNamespace(), variableName);
                XmlNamespace xsdNS = process.xml().lookupNamespaceByName(WSConstants.XSD_NS_URI);
                if (null != xsdNS && xsdNS.getPrefix() != null) {
                    ifVar.xml().setAttributeValue("element",
                            xsdNS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
                } else {
                    this.process.xml().declareNamespace(WSConstants.XSD_NS);
                    ifVar.xml().setAttributeValue("element",
                            WSConstants.XSD_NS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
                }
                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);
            }
        }
        if (copies.size() > 0) {
            GpelAssign assign = new GpelAssign(this.bpelNS, copies);
            sequence.addActivity(assign);
        }
        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",
                        xsdNS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
            } else {
                this.process.xml().declareNamespace(WSConstants.XSD_NS);
                ifVar.xml().setAttributeValue("element",
                        WSConstants.XSD_NS.getPrefix() + ":" + WSConstants.XSD_ANY_TYPE.getLocalPart());
            }
            this.process.getVariables().addVariable(ifVar);
        }
View Full Code Here

TOP

Related Classes of org.gpel.model.GpelVariable

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.