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

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


        try {
          leadCtxHeader = XBayaUtil.buildLeadContextHeader(this.getWorkflow(), this.getConfig().getConfiguration(), new MonitorConfiguration(this
              .getConfig().getConfiguration().getBrokerURL(), this.config.getTopic(), true, this.getConfig().getConfiguration()
              .getMessageBoxURL()), foreachWSNode.getID(), null);
        } catch (URISyntaxException e) {
          throw new WorkflowException(e);
        }
        invoker = new WorkflowInvokerWrapperForGFacInvoker(portTypeQName, gfacURLString, this.getConfig().getConfiguration().getMessageBoxURL()
            .toString(), leadCtxHeader, this.config.getNotifier().createServiceNotificationSender(foreachWSNode.getID()));
      } else {
        invoker = new GenericInvoker(portTypeQName, wsdlLocation, foreachWSNode.getID(), this.getConfig().getConfiguration().getMessageBoxURL()
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

      }
            if (inputs!=null) {
        try {
          this.registry.updateWorkflowNodeInput(new WorkflowInstanceNode(new WorkflowInstance(experimentId,experimentId),node.getID()),xsul5.XmlConstants.BUILDER.serializeToString(inputs));
        } 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.updateWorkflowNodeOutput(new WorkflowInstanceNode(new WorkflowInstance(experimentId,experimentId),node.getID()),xsul5.XmlConstants.BUILDER.serializeToString(outputs));
            } 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 ("-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.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

                    }
                }
            }

            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

            throw e;
        } catch (URISyntaxException e) {
            logger.error(e.getMessage(), e);
            String message = "The location of the WSDL has to be a valid URL or file path: " + this.serviceInformation;
            this.notifier.invocationFailed(message, e);
            throw new WorkflowException(message, e);
        } catch (WsdlException e) {
            logger.error(e.getMessage(), e);
            String message = "Error in processing the WSDL: " + this.serviceInformation;
            this.notifier.invocationFailed(message, e);
            throw new WorkflowException(message, e);
        } catch (RuntimeException e) {
            logger.error(e.getMessage(), e);
            String message = "Error in processing the WSDL: " + 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 = "The WSDL does not conform to the invoking 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);
        }
    }
View Full Code Here

            throw e;
        } 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);
        }
    }
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);
        }
        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

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.