Package org.gpel.model

Examples of org.gpel.model.GpelSequence


     * @param node
     * @param sequence
     */
    private void addStreamSource(StreamSourceNode node, GpelSequence sequence) {
        GpelFlow flow = new GpelFlow(this.bpelNS);
        new GpelSequence(this.bpelNS);
        sequence.addActivity(flow);

    }
View Full Code Here


    private void addForEach(ForEachNode splitNode, Collection<Node> parentBlock, GpelSequence sequence)
            throws GraphException {
        Set<Node> forEachBlock = getForEachBlock(splitNode);
        parentBlock.removeAll(forEachBlock);

        GpelSequence subSequence = new GpelSequence(this.bpelNS);
        GpelScope scope = new GpelScope(this.bpelNS, subSequence);

        String arrayName = splitNode.getID() + ARRAY_SUFIX;
        // 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 + "/*)",
                true /* parallel */, scope);

        sequence.addActivity(forEach);
View Full Code Here

        //
        // 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.
View Full Code Here

    private GpelSequence createIfSequence(IfNode ifNode, EndifNode endifNode, boolean ifBlock,
            Collection<Node> parentBlock) throws GraphException {
        Set<Node> block = getIfBlock(ifNode, ifBlock);
        parentBlock.removeAll(block);
        GpelSequence sequence = new GpelSequence(this.bpelNS);
        addBlock(block, sequence);

        // Create a copy to global variable.
        List<DataPort> outputPorts = endifNode.getOutputPorts();
        ArrayList<GpelAssignCopy> copies = new ArrayList<GpelAssignCopy>();
        for (int i = 0; i < outputPorts.size(); i++) {
            DataPort outputPort = outputPorts.get(i);
            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);

        return sequence;
    }
View Full Code Here

        //
        // normal block
        //
        EndBlockNode endBlockNode = getEndBlockNode(blockNode);
        GpelSequence normalSequence = createBlockSequence(blockNode, endBlockNode, true, parentBlock);
        GpelScope scope = new GpelScope(this.bpelNS, normalSequence);

        //
        // exception block
        //
View Full Code Here

    private GpelSequence createBlockSequence(BlockNode blockNode, EndBlockNode endBlockNode, boolean blockBlock,
            Collection<Node> parentBlock) throws GraphException {
        Set<Node> block = getBlockBlock(blockNode, blockBlock);
        parentBlock.removeAll(block);
        GpelSequence sequence = new GpelSequence(this.bpelNS);
        addBlock(block, sequence);

        // Create a copy to global variable.
        List<DataPort> outputPorts = endBlockNode.getOutputPorts();
        ArrayList<GpelAssignCopy> copies = new ArrayList<GpelAssignCopy>();
        for (int i = 0; i < outputPorts.size(); i++) {
            DataPort outputPort = outputPorts.get(i);
            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);

        return sequence;
    }
View Full Code Here

        this.process.xml().insertChild(0, comment);
        this.process.xml().insertChild(0, "\n");
    }

    private GpelSequence createMainSequence() throws GraphException {
        GpelSequence sequence = new GpelSequence(this.bpelNS);

        // Remove InputNodes and MemoNodes.
        removeUnnecessaryNodes(this.remainNodes);

        addInitialReceive(sequence);
View Full Code Here

    }

    private void addFlow(List<Node> nextNodes, Collection<Node> block, GpelSequence sequence) throws GraphException {
        GpelFlow flow = new GpelFlow(this.bpelNS);
        for (Node node : nextNodes) {
            GpelSequence childSequence = new GpelSequence(this.bpelNS);
            flow.addActivity(childSequence);
            addSingle(node, block, childSequence);
        }
        sequence.addActivity(flow);
    }
View Full Code Here

     * @param node
     * @param sequence
     */
    private void addStreamSource(StreamSourceNode node, GpelSequence sequence) {
        GpelFlow flow = new GpelFlow(this.bpelNS);
        new GpelSequence(this.bpelNS);
        sequence.addActivity(flow);

    }
View Full Code Here

    private void addForEach(ForEachNode splitNode, Collection<Node> parentBlock, GpelSequence sequence)
            throws GraphException {
        Set<Node> forEachBlock = getForEachBlock(splitNode);
        parentBlock.removeAll(forEachBlock);

        GpelSequence subSequence = new GpelSequence(this.bpelNS);
        GpelScope scope = new GpelScope(this.bpelNS, subSequence);

        String arrayName = splitNode.getID() + ARRAY_SUFIX;
        // 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 + "/*)",
                true /* parallel */, scope);

        sequence.addActivity(forEach);
View Full Code Here

TOP

Related Classes of org.gpel.model.GpelSequence

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.