Package org.apache.airavata.workflow.model.graph

Examples of org.apache.airavata.workflow.model.graph.GraphException


        String id = node.getID();
        Port port = node.getPort();

        Node fromNode = port.getFromNode();
        if (fromNode == null) {
            throw new GraphException("Output parameter has to be connected to some node.");
        }
        Port fromPort = port.getFromPort();
        if (fromNode instanceof InputNode) {
            // The OutputNode is directly connected to an InputNode.
            pw.println(TAB + id + VALUE_SUFFIX + " = " + PROPERTIES_VARIABLE + "." + GET_PROPERTY_METHOD + "('"
View Full Code Here


            return false;
        }
        for (Port port : node.getInputPorts()) {
            Collection<Node> fromNodes = port.getFromNodes();
            if (fromNodes.isEmpty()) {
                throw new GraphException("There is a port that is not connected to any.");
            } else {
                for (Node fromNode : fromNodes) {
                    if (this.notYetInvokedNodes.contains(fromNode)) {
                        // There is a node that should be executed before this
                        // node.
View Full Code Here

            } else if (BPELScriptType.GPEL == type) {
                GpelConstants.GPEL_NS = XmlInfosetBuilder.newInstance().newNamespace(GPEL, GPELNS);
                this.bpelNS = XmlInfosetBuilder.newInstance().newNamespace(GPEL, GPELNS);
                this.process = new GpelProcess(bpelNS, bpelTargetNamespace);
            } else {
                throw new GraphException("Unknown BPEL type " + type);
            }

            // Target namespace of the workflow WSDL
            this.targetNamespace = this.process.xml().declareNamespace(this.workflowWSDL.getTargetNamespace());

            // Types namespace of the workflow WSDL
            this.typesNamespace = this.process.xml().declareNamespace(this.workflowWSDL.getTypesNamespace());

            // xsd
            XMLUtil.declareNamespaceIfNecessary(WSConstants.XSD_NS.getPrefix(), WSConstants.XSD_NS.getName(), false,
                    this.process.xml());

            this.process.setActivity(createMainSequence());

            // comment
            addComment();

            // Validate
            this.process.xmlValidate();

            logger.info(this.process.xmlStringPretty());
        } catch (RuntimeException e) {
            throw new GraphException(e);
        }
    }
View Full Code Here

        addBlock(this.remainNodes, sequence);

        addFinalReply(sequence);

        if (this.remainNodes.size() > 0) {
            throw new GraphException("Some node(s) are not connected.");
        }

        return sequence;
    }
View Full Code Here

            addExit((ExitNode) node, sequence);
        } else if (node instanceof ResourceNode) {
            // nothing
        } else {

            throw new GraphException(node.getClass().getName() + " is not supported.");
        }
    }
View Full Code Here

                from.setVariable(fromNode.getID() + INPUT_SUFFIX);
            }
        } else if (fromNode instanceof InstanceNode) {
            // no op
        } else {
            throw new GraphException("Unexpected node," + fromNode.getClass().getName() + " is connected");
        }
        return from;
    }
View Full Code Here

    private void getSpecialBlock(Node node, int depth, Set<Node> block, Class startClass, Class endClass)
            throws GraphException {
        List<Node> nextNodes = GraphUtil.getNextNodes(node);
        for (Node nextNode : nextNodes) {
            if (nextNode instanceof OutputNode) {
                throw new GraphException("Nodes after " + startClass.getName()
                        + " cannot be connected to the output without going through " + endClass.getName() + ".");
            } else if (endClass.isInstance(nextNode)) {
                block.add(nextNode);
                if (depth == 0) {
                    // Stop the recursion here.
View Full Code Here

    private <S extends Node, E extends Node> E findEndNode(Node node, int depth, Class<S> startClass, Class<E> endClass)
            throws GraphException {
        List<Node> nextNodes = GraphUtil.getNextNodes(node);
        for (Node nextNode : nextNodes) {
            if (nextNode instanceof OutputNode) {
                throw new GraphException("Nodes after " + startClass.getName()
                        + " cannot be connected to the output without going through " + endClass.getName() + ".");
            } else if (endClass.isInstance(nextNode)) {
                if (depth == 0) {
                    // Stop the recursion here.
                    return (E) nextNode; // This cast is OK.
                } else {
                    return findEndNode(nextNode, depth - 1, startClass, endClass);
                }
            } else if (startClass.isInstance(nextNode)) {
                // handle embedded forEach
                return findEndNode(nextNode, depth + 1, startClass, endClass);
            } else {
                return findEndNode(nextNode, depth, startClass, endClass);
            }
        }
        throw new GraphException("Cannot find matching  " + endClass.getName() + " for " + startClass.getName() + ".");
    }
View Full Code Here

        //
        // Condition
        //
        String booleanExpression = ifNode.getXPath();
        if (booleanExpression == null) {
            throw new GraphException("XPath cannot be null");
        }
        // replace $1, $2,... with actual value.
        List<? extends Port> inputPorts = ifNode.getInputPorts();
        ArrayList<GpelAssignCopy> copies = new ArrayList<GpelAssignCopy>();
        for (int i = 0; i < inputPorts.size(); i++) {
View Full Code Here

    public void removeNode(Node node) throws GraphException {
        if (node == null) {
            throw new IllegalArgumentException("null");
        }
        if (!this.nodes.contains(node)) {
            throw new GraphException("The graph doesn't contain the node that is being removed.");
        }

        NodeImpl nodeImpl = (NodeImpl) node;

        // Have to be very careful to remove the node.
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.model.graph.GraphException

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.