Package org.apache.airavata.xbaya

Examples of org.apache.airavata.xbaya.XBayaRuntimeException


            } else if (toDataPort.getNode() == this) {
                if (!(fromType == null || fromType.equals(WSConstants.XSD_ANY_TYPE))) {
                    toDataPort.copyType(fromDataPort);
                }
            } else {
                throw new XBayaRuntimeException();
            }
        }
    }
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 XBayaRuntimeException();
        }

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

   */
  public static Node findEndForEachFor(ForEachNode node) {

    Collection<Node> toNodes = node.getOutputPort(0).getToNodes();
    if(toNodes.size() != 1){
      throw new XBayaRuntimeException("ForEach output does not contain single out-edge");
    }
    Node middleNode = toNodes.iterator().next();
    List<DataPort> outputPorts = middleNode.getOutputPorts();
    for (DataPort dataPort : outputPorts) {
      if(dataPort.getToNodes().size() == 1){
        Node possibleEndForEachNode = dataPort.getToNodes().get(0);
        if(possibleEndForEachNode instanceof EndForEachNode){
          return possibleEndForEachNode;
        }
      }
    }
    throw new XBayaRuntimeException("EndForEachNode not found");
  }
View Full Code Here

            throw new IllegalArgumentException(
                    "Event must be an workflowInitialized type or an workflowTerminated type instead of " + type);
        }
        XmlElement notificationSource = event.element(WOR_NS, NOTIFICATION_SOURCE_TAG);
        if (notificationSource == null) {
            throw new XBayaRuntimeException("The notification should have " + NOTIFICATION_SOURCE_TAG + " element.");
        }
        String workflowInstanceID = notificationSource.attributeValue(WOR_NS, SERVICE_ID_ATTRIBUTE);
        if (workflowInstanceID == null) {
            throw new XBayaRuntimeException("The notification should have " + SERVICE_ID_ATTRIBUTE + " attribute.");
        }
        try {
            return new URI(workflowInstanceID);
        } catch (URISyntaxException e) {
            throw new XBayaRuntimeException(e);
        }
    }
View Full Code Here

                        } catch (InterruptedException e) {
                            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
                        }
                        count++;
                        if(count > 20){
                            throw new XBayaRuntimeException("Error stopping previous workflow Execution");
                        }
                    }
                   
                }
                this.window = new DynamicWorkflowRunnerWindow(engine);
View Full Code Here

            } else if (kind == Kind.DATA_IN || kind == Kind.CONTROL_IN) {
                p1 = this.mousePoint;
                p2 = this.draggedPort.getGUI().getPosition();
            } else {
                // This should not happen.
                throw new XBayaRuntimeException();
            }
            g.setColor(Color.RED);

            Stroke originalStroke = g.getStroke();
            if (kind == Kind.CONTROL_IN || kind == Kind.CONTROL_OUT) {
View Full Code Here

    public static Object parseValue(WSComponentPort input, String valueString) {
        String name = input.getName();
        if (false) {
            // Some user wants to pass empty strings, so this check is disabled.
            if (valueString.length() == 0) {
                throw new XBayaRuntimeException("Input parameter, " + name + ", cannot be empty");
            }
        }
        QName type = input.getType();
        Object value;
        if (LEADTypes.isKnownType(type)) {
            // TODO check the type.
            value = valueString;
        } else {
            try {
                if(XBayaConstants.HTTP_SCHEMAS_AIRAVATA_APACHE_ORG_GFAC_TYPE.equals(input.getType().getNamespaceURI())){
                    value = XMLUtil.stringToXmlElement3(ODEClientUtil.createInputForGFacService(input, valueString));
                }else {
                    throw new XBayaRuntimeException("Input parameter, " + name + ", Unkown Type");
                }
            } catch (RuntimeException e) {
                throw new XBayaRuntimeException("Input parameter, " + name + ", is not valid XML", e);
            }
        }
        return value;
    }
View Full Code Here

TOP

Related Classes of org.apache.airavata.xbaya.XBayaRuntimeException

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.