Package org.gpel.model

Examples of org.gpel.model.GpelAssignCopyTo


        List<OutputNode> outputNodes = GraphUtil.getNodes(this.graph, OutputNode.class);
        this.remainNodes.removeAll(outputNodes);
        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) {
View Full Code Here


            if (fromPort == null) {
                // optional input
                continue;
            }
            GpelAssignCopyFrom from = createAssignCopyFrom(port);
            GpelAssignCopyTo to = createAssignCopyTo(port, true);

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

     * @param toPort
     * @param input
     * @return The GpelAssignCopyTo created
     */
    private GpelAssignCopyTo createAssignCopyTo(Port toPort, boolean input) {
        GpelAssignCopyTo to = new GpelAssignCopyTo(this.bpelNS);

        Node toNode = toPort.getNode();
        if (toNode instanceof OutputNode) {
            to.setVariable(WORKFLOW_OUTPUT_NAME);
            to.setPart(WorkflowWSDL.OUTPUT_PART_NAME);
            to.setQuery("/" + this.typesNamespace.getPrefix() + ":"
                    + this.workflowWSDL.getWorkflowOutputMessageElementName() + "/" + toNode.getID());
        } else {
            WSComponentPort toComponentPort = (WSComponentPort) toPort.getComponentPort();

            String toID = toNode.getID();
            WSComponent toWSComponent = (WSComponent) toNode.getComponent();
            to.setVariable(toID + INPUT_SUFFIX);
            to.setPart(toWSComponent.getInputPartName());

            if (toComponentPort.isSchemaUsed()) {
                // Normal case.
                // e.g. <part name="name" type="typens:fooType">
                String typesTargetNamespace = toComponentPort.getTargetNamespace();
                XmlNamespace namespace = XMLUtil.declareNamespaceIfNecessary(toID.toLowerCase() + TYPENS_SUFFIX,
                        typesTargetNamespace, false, this.process.xml());

                String typeName = input ? toWSComponent.getInputTypeName() : toWSComponent.getOutputTypeName();
                to.setQuery("/" + namespace.getPrefix() + ":" + typeName + "/" + toComponentPort.getName());
            } else {
                // e.g. <part name="name" type="xsd:string">
                // No query is needed?
            }
        }
View Full Code Here

        // TODO This should be type instead of messageType
        this.process.addMessageVariable(arrayName, WSConstants.XSD_NS, WSConstants.XSD_ANY_TYPE.getLocalPart());

        // 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 + "/*)",
 
View Full Code Here

                            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);
            }
View Full Code Here

            String variable = outputPort.getID() + OUTPUT_SUFFIX;
            int index = ifBlock ? i : i + outputPorts.size();
            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

            String variable = outputPort.getID() + OUTPUT_SUFFIX;
            int index = blockBlock ? i : i + outputPorts.size();
            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.GpelAssignCopyTo

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.