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

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


            throw e;
        } catch (RuntimeException e) {
            logger.error(e.getMessage(), e);
            String message = "Error while waiting for a output: " + name;
            this.notifier.invocationFailed(message, e);
            throw new WorkflowException(message, e);
        } catch (Error e) {
            logger.error(e.getMessage(), e);
            String message = "Unexpected error: " + this.serviceInformation;
            this.notifier.invocationFailed(message, e);
            throw new WorkflowException(message, e);
        }
        throw new WorkflowException("Output could not be found");
    }
View Full Code Here


                    try {
                        this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().setWorkflowInstanceStatus(
                                this.config.getTopic(), this.config.getTopic(), State.FINISHED);
                    } catch (Exception e) {
                        throw new WorkflowException(e);
                    }

          // System.out.println(this.config.getConfiguration().getJcrComponentRegistry().getRegistry().getWorkflowStatus(this.topic));
        }
      } else {
        if (this.config.isActOnProvenance()) {
          try {
            this.getConfig().getConfiguration().getAiravataAPI().getProvenanceManager().
                                setWorkflowInstanceStatus(this.config.getTopic(),this.config.getTopic(), State.FAILED);
          } catch (AiravataAPIInvocationException e) {
            throw new WorkflowException(e);
          }
        }
      }
      this.config.getNotifier().workflowTerminated();
      UUID uuid = UUID.randomUUID();
View Full Code Here

    try {
      WorkflowInterpreter subworkflowInterpreter = (WorkflowInterpreter) getInputViaInteractor(
          WorkflowExecutionMessage.INPUT_WORKFLOWINTERPRETER_FOR_WORKFLOW, subWorkflow);
      subworkflowInterpreter.scheduleDynamically();
    } catch (Exception e) {
      throw new WorkflowException(e);
    }
  }
View Full Code Here

          inputValues.add(inputValue);
        }

      }
    } catch (ArrayIndexOutOfBoundsException e) {
      throw new WorkflowException("Wrong number of Inputs to For EachNode");
    }
    return inputValues;
  }
View Full Code Here

            this.inputValues.add(value);
        } catch (RuntimeException e) {
            logger.error(e.getMessage(), e);
            String message = "Error in setting an input. name: " + name + " value: " + value;
            this.notifier.invocationFailed(message, e);
            throw new WorkflowException(message, e);
        } catch (Error e) {
            logger.error(e.getMessage(), e);
            String message = "Unexpected error: " + this.serviceInformation;
            this.notifier.invocationFailed(message, e);
            throw new WorkflowException(message, e);
        } catch (Exception e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }
    }
View Full Code Here

        } catch (RuntimeException e) {
            logger.error(e.getMessage(), e);
            String message = "Error in invoking a service: " + this.serviceInformation;
            this.notifier.invocationFailed(message, e);
            throw new WorkflowException(message, e);
        } catch (Error e) {
            logger.error(e.getMessage(), e);
            String message = "Unexpected error: " + this.serviceInformation;
            this.notifier.invocationFailed(message, e);
            throw new WorkflowException(message, e);
        } catch (Exception e) {
            this.notifier.invocationFailed(e.getMessage(), e);
            throw new WorkflowException(e.getMessage(), e);
        }
        return true;
    }
View Full Code Here

                String message = "Error in a service: ";
                // An implementation of WSIFMessage,
                // WSIFMessageElement, implements toString(), which
                // serialize the message XML.
                message += faultMessage.toString();
                throw new WorkflowException(message);
            }
        } catch (RuntimeException e) {
            logger.error(e.getMessage(), e);
            String message = "Error while waiting for a service to finish: " + this.serviceInformation;
            this.notifier.invocationFailed(message, e);
            throw new WorkflowException(message, e);
        } catch (Error e) {
            logger.error(e.getMessage(), e);
            String message = "Unexpected error: " + this.serviceInformation;
            this.notifier.invocationFailed(message, e);
            throw new WorkflowException(message, e);
        }
    }
View Full Code Here

            throw e;
        } catch (RuntimeException e) {
            logger.error(e.getMessage(), e);
            String message = "Error while waiting for a output: " + name;
            this.notifier.invocationFailed(message, e);
            throw new WorkflowException(message, e);
        } catch (Error e) {
            logger.error(e.getMessage(), e);
            String message = "Unexpected error: " + this.serviceInformation;
            this.notifier.invocationFailed(message, e);
            throw new WorkflowException(message, e);
        }
    }
View Full Code Here

                    try {
                        this.config.loadConfiguration(configPath);
                    } catch (RuntimeException e) {
                        String message = "Error while reading config file, " + configPath;
                        logger.warn(message, e);
                        this.config.addError(new WorkflowException(message, e));
                    }
                } else if ("-title".equalsIgnoreCase(arg)) {
                    index++;
                    this.config.setTitle(args[index]);
                } else if ("-workflow".equalsIgnoreCase(arg)) {
                    index++;
                    this.config.setWorkflow(args[index]);
                } else if ("-gfacURL".equalsIgnoreCase(arg)) {
                    index++;
                    String url = args[index];
                    try {
                        this.config.setGFacURL(parseURL(url));
                    } catch (URISyntaxException e) {
                        String message = "The GFac URL is in wrong format: " + url;
                        logger.warn(message, e);
                        this.config.addError(new WorkflowException(message, e));
                    }
                } else if ("-dscURL".equalsIgnoreCase(arg)) {
                    index++;
                    String url = args[index];
                    try {
                        this.config.setDSCURL(parseURL(url));
                    } catch (URISyntaxException e) {
                        String message = "The DSC URL is in wrong format: " + url;
                        logger.warn(message, e);
                        this.config.addError(new WorkflowException(message, e));
                    }
                } else if ("-startMonitor".equalsIgnoreCase(arg)) {
                    this.config.setStartMonitor(true);
                } else if ("-brokerURL".equalsIgnoreCase(arg)) {
                    index++;
                    String brokerURL = args[index];
                    try {
                        this.config.setBrokerURL(parseURL(brokerURL));
                    } catch (URISyntaxException e) {
                        String message = "The broker URL is in wrong format: " + brokerURL;
                        logger.warn(message, e);
                        this.config.addError(new WorkflowException(message, e));
                    }
                } else if ("-odeEngine".equalsIgnoreCase(arg)) {
                    index++;
                    this.config.setOdeURL(args[index]);

                } else if ("-templateID".equalsIgnoreCase(arg)) {
                    index++;
                    this.config.setWorkflow(args[index]);

                } else if ("-topic".equalsIgnoreCase(arg)) {

                    index++;
                    this.config.setTopic(args[index]);
                } else if ("-pullMode".equalsIgnoreCase(arg)) {
                    if (index < args.length - 1) {
                        String nextArg = args[index + 1];
                        if (nextArg.startsWith("-")) {
                            this.config.setPullMode(true);
                        } else if ("true".equalsIgnoreCase(nextArg)) {
                            index++;
                            this.config.setPullMode(true);
                        } else if ("false".equalsIgnoreCase(nextArg)) {
                            index++;
                            this.config.setPullMode(false);
                        } else {
                            String message = "-pullMode has to be either true or false, not " + nextArg;
                            logger.warn(message);
                            this.config.addError(new WorkflowException(message));
                        }
                    } else {
                        // This is the last arg
                        this.config.setPullMode(true);
                    }
                } else if ("-messageBoxURL".equalsIgnoreCase(arg) || "-msgBoxURL".equalsIgnoreCase(arg)) {
                    index++;
                    String messageBoxURL = args[index];
                    try {
                        this.config.setMessageBoxURL(parseURL(messageBoxURL));
                    } catch (URISyntaxException e) {
                        String message = "The message box URL is in wrong format: " + messageBoxURL;
                        logger.warn(message, e);
                        this.config.addError(new WorkflowException(message, e));
                    }
                } else if ("-registryURL".equalsIgnoreCase(arg)) {
                    index++;
                    String registryURL = args[index];
                    try {
                        this.config.setRegistryURL(parseURL(registryURL));
                    } catch (URISyntaxException e) {
                        String message = "The message box URL is in wrong format: " + registryURL;
                        logger.warn(message, e);
                        this.config.addError(new WorkflowException(message, e));
                    }
                    } else if ("-registryUserName".equalsIgnoreCase(arg)) {

                    index++;
                    this.config.setRegigstryUserName(args[index]);
                } else if ("-registryPassphrase".equalsIgnoreCase(arg)) {

                    index++;
                    this.config.setRegistryPassphrase(args[index]);
                } else if ("-width".equalsIgnoreCase(arg)) {
                    index++;
                    String width = args[index];
                    try {
                        this.config.setWidth(Integer.parseInt(width));
                    } catch (NumberFormatException e) {
                        String message = "The width must be an integer: " + width;
                        logger.warn(message, e);
                        this.config.addError(new WorkflowException(message, e));
                    }
                } else if ("-height".equalsIgnoreCase(arg)) {
                    index++;
                    String height = args[index];
                    try {
                        this.config.setHeight(Integer.parseInt(height));
                    } catch (NumberFormatException e) {
                        String message = "The height must be an integer: " + height;
                        logger.warn(message, e);
                        this.config.addError(new WorkflowException(message, e));
                    }
                } else if ("-exitOnClose".equalsIgnoreCase(arg)) {
                    index++;
                    String exit = args[index];
                    if ("false".equalsIgnoreCase(exit)) {
                        this.config.setCloseOnExit(false);
                    }
                }  else if ("-enableProvenance".equalsIgnoreCase(arg)) {
                    index++;
                    String exit = args[index];
                    if ("true".equalsIgnoreCase(exit)) {
                        this.config.setCollectProvenance(true);
                    }
                }  else if ("-enableProvenanceSmartRun".equalsIgnoreCase(arg)) {
                    index++;
                    String exit = args[index];
                    if ("true".equalsIgnoreCase(exit)) {
                        this.config.setProvenanceSmartRun(true);
                    }
                }  else if ("-runWithCrossProduct".equalsIgnoreCase(arg)) {
                    index++;
                    String exit = args[index];
                    if ("false".equalsIgnoreCase(exit)) {
                        this.config.setRunWithCrossProduct(false);
                    }
                }  else if ("-mode".equalsIgnoreCase(arg)) {
                  index++;
                  String modeValue = args[index].toUpperCase();
                  this.config.setXbayaExecutionMode(XBayaExecutionMode.valueOf(modeValue));
                } else if ("-x".equalsIgnoreCase(arg)) {
                    index++;
                    this.config.setX(Integer.parseInt(args[index]));
                } else if ("-y".equalsIgnoreCase(arg)) {
                    index++;
                    this.config.setY(Integer.parseInt(args[index]));
                } else {
                    String message = "Unknown option: " + arg;
                    logger.error(message);
                    this.config.addError(new WorkflowException(message));
                }
                this.config.setJcrComponentRegistry(new
                        JCRComponentRegistry(this.config.getRegistryURL(),this.config.getRegistryUserName(),this.config.getRegistryPassphrase()));
                index++;
            }
        } catch (ArrayIndexOutOfBoundsException e) {
            String message = "Argument is missing after " + args[args.length - 1];
            logger.error(message, e);
            this.config.addError(new WorkflowException(message));
        } catch (Throwable e) {
            logger.error(e.getMessage(), e);
            String message = "Unknown error while parsing the arguments";
            this.config.addError(new WorkflowException(message, e));
        }
       
    }
View Full Code Here

                    return null;
                }
            });
        } catch (PrivilegedActionException e) {
            logger.error(e.getMessage(), e);
            throw new WorkflowException(e.getCause());
        }

    }
View Full Code Here

TOP

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

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.