Examples of GraphException


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

                    WSComponentPort componentPort = ((WSPort) fromDataPort).getComponentPort();
                    setDescription(componentPort.getDescription());
                    setMetadata(componentPort.getAppinfo());
                }
            } else {
                throw new GraphException("Cannot connect more than one output ports to the output parameter.");
            }
        }
    }
View Full Code Here

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

                }
            } else if (edges.size() > 1) {
                // Not the first edge.
                QName parameterType = getParameterType();
                if (!toType.equals(WSConstants.XSD_ANY_TYPE) && !parameterType.equals(toType)) {
                    throw new GraphException("Cannot connect ports with different types.");
                }

            } else {
                // Should not happen.
                throw new WorkflowRuntimeException("edges.size(): " + edges.size());
View Full Code Here

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

            } 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.debug(this.process.xmlStringPretty());
        } catch (RuntimeException e) {
            throw new GraphException(e);
        }
    }
View Full Code Here

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

        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

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

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

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

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

                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

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

    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

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

    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

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

        //
        // 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

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

            Node toNode = toPort.getNode();
            Port fromPort = edge.getFromPort();
            Node fromNode = fromPort.getNode();

            if (!(toNode instanceof ResourceNode && fromNode instanceof ResourceNode)) {
                throw new GraphException("Cannot connect Resource Node to other type of nodes");
            }
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.