Package org.apache.airavata.workflow.model.exceptions

Examples of org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException


        if (fromPort == wsPort) {
          toPort.copyType(wsPort);
        } else if (toPort == wsPort) {
          fromPort.copyType(wsPort);
        } else {
          throw new WorkflowRuntimeException();
        }
      }
    }

  }
View Full Code Here


   * @param node
   * @return null if not the same
   */
  public static String isSameLabeledInput(Node node) {
    if (!isAllInputsConnected(node)) {
      throw new WorkflowRuntimeException("Node inputs not connected" + node);
    }
    if (!isAllInputsLabeled(node)) {
      throw new WorkflowRuntimeException(
          "Some or all of the node inputs not labeled" + node);
    }
    List<DataPort> inputPorts = node.getInputPorts();
    String label = inputPorts.get(0).getEdge(0).getLabel();
    for (DataPort dataPort : inputPorts) {
View Full Code Here

     * @param node
     * @return
     */
  public static String getEncodedInputLabels(Node node) {
    if (!isAllInputsConnected(node)) {
      throw new WorkflowRuntimeException("Node inputs not connected" + node);
    }
    if (!isAllInputsLabeled(node)) {
      throw new WorkflowRuntimeException(
          "Some or all of the node inputs not labeled" + node);
    }
    List<DataPort> inputPorts = node.getInputPorts();
    String label = "";
    for (DataPort dataPort : inputPorts) {
View Full Code Here

  public EdgeImpl createEdge(Port fromPort, Port toPort) {
    Kind fromKind = fromPort.getKind();
    Kind toKind = toPort.getKind();
    if (!((fromKind == Kind.DATA_OUT && toKind == Kind.DATA_IN)
        || (fromKind == Kind.CONTROL_OUT && toKind == Kind.CONTROL_IN) || (fromKind == Kind.EPR && toKind == Kind.DATA_IN))) {
      throw new WorkflowRuntimeException();
    }
    EdgeImpl edge;
    if (toKind == Kind.DATA_IN) {
      edge = new DataEdge();
    } else if (toKind == Kind.CONTROL_IN) {
      edge = new ControlEdge();
    } else {
      // Should not happen.
      throw new WorkflowRuntimeException();
    }
    return edge;
  }
View Full Code Here

            src = classes;

        // create temp directory
        File tempdir = null;
        if (src == null || classes == null) {
            throw new WorkflowRuntimeException("Code gen src directory or classes directory is null");
        }

        File jarfile = null;
        if (outputfilename == null && classes == null && !nojavac)
            outputfilename = "xmltypes.jar";
View Full Code Here

     * @param edge
     *            The edge to add
     */
    protected void addEdge(EdgeImpl edge) {
        if (this.edges.contains(edge)) {
            throw new WorkflowRuntimeException("The edge is already addes");
        } else {
            this.edges.add(edge);
        }
    }
View Full Code Here

    protected void removeEdge(Edge edge) {
        if (this.edges.contains(edge)) {
            this.edges.remove(edge);
            // this.node.edgeWasRemoved(edge);
        } else {
            throw new WorkflowRuntimeException("The edge doesn't exist.");
        }
    }
View Full Code Here

        case EPR:
            portType = "epr";
            break;
        default:
            // Should not happen.
            throw new WorkflowRuntimeException("Wrong type of the port: " + this.kind);
        }
        int index = getIndex();
        return nid + "_" + portType + "_" + index;
    }
View Full Code Here

                if (!(fromType == null || fromType
                        .equals(WSConstants.XSD_ANY_TYPE))) {
                    toDataPort.copyType(fromDataPort);
                }
            } else {
                throw new WorkflowRuntimeException();
            }
        }
    }
View Full Code Here

        if (kind == Kind.DATA_IN) {
            index = inputPorts.indexOf(port);
        } else if (kind == Kind.DATA_OUT) {
            index = outputPorts.indexOf(port);
        } else {
            throw new WorkflowRuntimeException();
        }

        SystemDataPort inputPort = (SystemDataPort) inputPorts.get(index);
        SystemDataPort outputPort = (SystemDataPort) outputPorts.get(index);

        QName inputType = inputPort.getType();
        QName outputType = outputPort.getType();

        QName portType = port.getType();
        if (portType == null || portType.equals(WSConstants.XSD_ANY_TYPE)) {
            // Do nothing
            return;
        }

        if (port == inputPort) {
            // input -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
              //  outputPort.copyType(port, -1);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                // XXX cannot parse array from WSDL.
                // String message = "The type of input " + index + " ("
                // + inputType + ") of " + getID()
                // + " must be same as the type of output " + index + " ("
                // + outputType + ").";
                // throw new GraphException(message);
            }

        } else if (port == outputPort) {
            // output -> input1
            if (inputType.equals(WSConstants.XSD_ANY_TYPE)) {
               // inputPort.copyType(port, 1);
            } else if (inputType.equals(portType)) {
                // Do nothing.
            } else {
                // XXX cannot parse array from WSDL.
                // String message = "The type of input " + index + " ("
                // + inputType + ") of " + getID()
                // + " must be same as the type of output " + index + " ("
                // + outputType + ").";
                // throw new GraphException(message);
            }
        } else {
            throw new WorkflowRuntimeException();
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.workflow.model.exceptions.WorkflowRuntimeException

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.