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

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


                    selectionPathHolder[0] = ComponentSelector.this.tree.getSelectionPath();
                }
            });
        } catch (InterruptedException e) {
            // Should not happen.
            throw new WorkflowRuntimeException(e);
        } catch (InvocationTargetException e) {
            // Should not happen.
            throw new WorkflowRuntimeException(e);
        }

        TreePath selectionPath = selectionPathHolder[0];
        if (selectionPath == null) {
            // TODO this case should be handled in the menu before comming here.
View Full Code Here


                        getRegistries(registries);
                    }
                });
            } catch (InterruptedException e) {
                // Should not happen.
                throw new WorkflowRuntimeException(e);
            } catch (InvocationTargetException e) {
                // Should not happen.
                throw new WorkflowRuntimeException(e);
            }
        }

        final List<ComponentTreeNode> newSubTrees = new ArrayList<ComponentTreeNode>();
        for (ComponentRegistry registry : registries) {
View Full Code Here

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

        DataPort inputPort1 = inputPorts.get(index);
        DataPort inputPort2 = inputPorts.get(size + index);
        DataPort outputPort = outputPorts.get(index);

        QName inputType1 = inputPort1.getType();
        QName inputType2 = inputPort2.getType();
        QName outputType = outputPort.getType();

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

        if (port == inputPort1) {
            // input1 -> input2
            if (inputType2.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort2.copyType(port);
            } else if (inputType2.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of input " + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input1 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of output " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }

        } else if (port == inputPort2) {
            // input2 -> input1
            if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort1.copyType(port);
            } else if (inputType1.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of input " + (index + size) + " (" + inputType2 + ").";
                throw new GraphException(message);
            }
            // input2 -> output
            if (outputType.equals(WSConstants.XSD_ANY_TYPE)) {
                outputPort.copyType(port);
            } else if (outputType.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + (index + size) + " (" + inputType2 + ") of " + getID()
                        + " must be same as the type of output " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }
        } else if (port == outputPort) {
            // output -> input1
            if (inputType1.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort1.copyType(port);
            } else if (inputType1.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + index + " (" + inputType1 + ") of " + getID()
                        + " must be same as the type of output " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }
            // output -> input2
            if (inputType2.equals(WSConstants.XSD_ANY_TYPE)) {
                inputPort2.copyType(port);
            } else if (inputType2.equals(portType)) {
                // Do nothing.
            } else {
                String message = "The type of input " + (index + size) + " (" + inputType2 + ") of " + getID()
                        + " must be same as the type of input " + index + " (" + outputType + ").";
                throw new GraphException(message);
            }
        } else {
            throw new WorkflowRuntimeException();
        }
    }
View Full Code Here

    return workflowInterpreter;
  }

  public void registerWorkflowInterpreter(WorkflowInterpreter workflowInterpreter) {
    if (getWorkflowInterpreter()!=null){
      throw new WorkflowRuntimeException("Critical Error!!! Workflow interpretter already running. Cleanup first");
    }
    this.workflowInterpreter = workflowInterpreter;
  }
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 WorkflowRuntimeException("The notification should have " + NOTIFICATION_SOURCE_TAG + " element.");
        }
        String workflowInstanceID = notificationSource.attributeValue(WOR_NS, SERVICE_ID_ATTRIBUTE);
        if (workflowInstanceID == null) {
            throw new WorkflowRuntimeException("The notification should have " + SERVICE_ID_ATTRIBUTE + " attribute.");
        }
        try {
            return new URI(workflowInstanceID);
        } catch (URISyntaxException e) {
            throw new WorkflowRuntimeException(e);
        }
    }
View Full Code Here

                    inputNode.setDefaultValue(input.getValue());
                    break;
                }
            }
            if (inputNode.getDefaultValue() == null) {
                throw new WorkflowRuntimeException("Could not find a input value for component with name :" + inputNode.getName());
            }

        }
        System.err.println("Input all set");

        XBayaConfiguration conf = null;
        try {
            conf = getConfiguration(configurations);
            conf.setTopic(topic);
            conf.setRunWithCrossProduct(true);
        } catch (URISyntaxException e1) {
            throw new WorkflowRuntimeException(e1);
        }
        WorkflowInterpretorEventListener listener = null;
        WorkflowInterpreter interpreter = null;
        AiravataRegistry2 registry = getRegistry();
    WorkflowInterpreterConfiguration workflowInterpreterConfiguration = new WorkflowInterpreterConfiguration(workflow,topic,conf.getMessageBoxURL(), conf.getBrokerURL(), registry, conf, null, null);
View Full Code Here

    private void executeWorkflow(WorkflowInterpreter interpreter, WorkflowInterpretorEventListener listener,String experimentId) {
        try {
            interpreter.scheduleDynamically();
            System.err.println("Called the interpreter");
        } catch (Exception e) {
            throw new WorkflowRuntimeException(e);
        } finally {
            /*
             * stop listener no matter what happens
             */
            try {
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 WorkflowRuntimeException("Error stopping previous workflow Execution");
                        }
                    }
                   
                }
                this.window = new DynamicWorkflowRunnerWindow(engine);
View Full Code Here

                            "Cannot connect ports with different types.");
                }

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

   */
  public static Node findEndForEachFor(ForEachNode node) {

    Collection<Node> toNodes = node.getOutputPort(0).getToNodes();
    if(toNodes.size() != 1){
      throw new WorkflowRuntimeException("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 WorkflowRuntimeException("EndForEachNode not found");
  }
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.