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

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


        try {
          this.registry.saveWorkflowExecutionServiceInput(new WorkflowServiceIOData(
              xsul5.XmlConstants.BUILDER.serializeToString(inputs),
              experimentId, node.getID(), this.workflowName));
        } catch (RegistryException e) {
          throw new WorkflowException(e);
        }
        // deal with the outputs
      }
      XmlElement outputs = elem.newElement("outputs");
      elem.addChild(outputs);

      List<DataPort> outputPorts = node.getOutputPorts();
      for (DataPort outputPort : outputPorts) {
        String outputName = outputPort.getName();

        XmlElement outputParamElement = outputs.newElement(outputName);
        outputs.addChild(outputParamElement);
        Object ouputParamValue = invokerMap.get(node).getOutput(
            outputName);

        if (ouputParamValue instanceof org.xmlpull.v1.builder.XmlElement) {
          ouputParamValue = XMLUtil
              .xmlElement3ToXmlElement5((org.xmlpull.v1.builder.XmlElement) ouputParamValue);
        }

        if (ouputParamValue != null) {
          outputParamElement.addChild(ouputParamValue);
        } else {
          outputParamElement.addChild("null");
        }
      }
            try {
        this.registry.saveWorkflowExecutionServiceOutput(new WorkflowServiceIOData(xsul5.XmlConstants.BUILDER.serializeToString(outputs), experimentId, node.getID(),this.workflowName));
            } catch (RegistryException e) {
        throw new WorkflowException(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 ("-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 ("-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));
                }
                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

                    }
                }
            }

            if (((String) outputVal).length() == 0) {
                throw new WorkflowException("Empty Output Generated");
            }
            outputVal = ((String) outputVal).substring(1, ((String) outputVal).length());
        } else {
            Invoker fromInvoker = invokerMap.get(fromNode);
            try {
View Full Code Here

        }
        if (exception != null) {
            if (exception instanceof WorkflowException) {
                throw (WorkflowException) exception;
            } else {
                throw new WorkflowException(exception);
            }
        }
    }
View Full Code Here

            }
        } 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 (RegistryException e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        } catch (Exception e) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }
View Full Code Here

            } catch (ExecutionException e) {
                // The service-failed notification should have been sent
                // already.
                logger.error(e.getMessage(), e);
                String message = "Error in invoking a service: " + this.serviceInformation;
                throw new WorkflowException(message, e);
            }
        } 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) {
            e.printStackTrace()//To change body of catch statement use File | Settings | File Templates.
        }
        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 (InterruptedException e) {
            logger.error(e.getMessage(), e);
        } catch (ExecutionException e) {
            // The service-failed notification should have been sent already.
            logger.error(e.getMessage(), e);
            String message = "Error in invoking a service: " + this.serviceInformation;
            throw new WorkflowException(message, e);
        } 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

            WSIFPort port = service.getPort();
            this.client = WSIFRuntime.getDefault().newClientFor(port);
            this.client.setAsyncResponseTimeoutInMs(999999999);
        } catch (RuntimeException e) {
            String message = "The WSDL is in the wrong format";
            throw new WorkflowException(message, e);
        }
    }
View Full Code Here

            this.inputMessage = this.operation.createInputMessage();
            this.outputMessage = this.operation.createOutputMessage();
            this.faultMessage = this.operation.createFaultMessage();
        } catch (RuntimeException e) {
            String message = "The WSDL does not conform to the invoking service.";
            throw new WorkflowException(message, e);
        }
    }
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.