Examples of WorkflowException


Examples of com.amazonaws.services.simpleworkflow.flow.WorkflowException

        @Override
        protected void doCatch(Throwable e) throws Throwable {
            failed = true;
            if (e instanceof WorkflowException) {
                WorkflowException we = (WorkflowException) e;
                throw new ChildWorkflowFailedException(0, childExecution, parameters.getWorkflowType(), e.getMessage(),
                        we.getDetails());
            }
            else if (e instanceof CancellationException) {
                throw e;
            }
            // Unless there is problem in the framework or generic workflow implementation this shouldn't be executed
View Full Code Here

Examples of com.day.cq.workflow.WorkflowException

        if (asset == null) {
            String wfPayload = workItem.getWorkflowData().getPayload().toString();
            String message = "execute: cannot process audio, asset [{" + wfPayload
                    + "}] in payload doesn't exist for workflow [{" + workItem.getId() + "}].";
            throw new WorkflowException(message);
        }

        final String assetMimeType = asset.getMimeType();
        if (assetMimeType == null || !assetMimeType.startsWith("audio/")) {
            if (!asset.getName().endsWith(".wav") || !asset.getName().endsWith(".mp3")
                    || !asset.getName().endsWith(".ogg")) {
                log.info("execute: asset [{}] is not of a audio mime type, asset ignored.", asset.getPath());
                return;
            }
        }

        File tmpDir = null;
        File tmpWorkingDir = null;
        FileOutputStream fos = null;
        InputStream is = null;
        FFMpegWrapper wrapper = null;
        try {
            // creating temp directory
            tmpDir = createTempDir(null);

            // creating temp working directory for ffmpeg
            tmpWorkingDir = createTempDir(getWorkingDir());

            // streaming file to temp directory
            final File tmpFile = new File(tmpDir, asset.getName().replace(' ', '_'));
            fos = new FileOutputStream(tmpFile);
            is = asset.getOriginal().getStream();
            IOUtils.copy(is, fos);

            processAudio(metaData, asset, tmpFile, wfSession);

            // get information about original audio file (size, video length,
            // ...)
            wrapper = new FFMpegWrapper(tmpFile, tmpWorkingDir);
            wrapper.setExecutableLocator(locator);

            final ResourceResolver resolver = getResourceResolver(wfSession.getSession());
            final Resource assetResource = asset.adaptTo(Resource.class);
            final Resource metadata = resolver.getResource(assetResource, JCR_CONTENT + "/" + METADATA_FOLDER);

            if (null != metadata) {

                final Node metadataNode = metadata.adaptTo(Node.class);
                metadataNode.setProperty(DC_EXTENT, wrapper.getInputDuration());

                metadataNode.getSession().save();
            } else {
                log.warn("execute: failed setting metdata for asset [{}] in workflow [{}], no metdata node found.",
                        asset.getPath(), workItem.getId());
            }

        } catch (IOException e) {
            throw new WorkflowException(e);
        } catch (RepositoryException e) {
            throw new WorkflowException(e);
        } catch (FfmpegNotFoundException e) {
            log.error(e.getMessage(), e);
        } finally {
            IOUtils.closeQuietly(is);
            IOUtils.closeQuietly(fos);
            try {
                // cleaning up temp directory
                if (tmpDir != null) {
                    FileUtils.deleteDirectory(tmpDir);
                }
            } catch (IOException e) {
                log.error("Could not delete temp directory: {}", tmpDir.getPath());
                throw new WorkflowException(e);

            }
            try {
                // cleaning up ffmpeg's temp working directory
                if (tmpWorkingDir != null) {
View Full Code Here

Examples of com.opensymphony.workflow.WorkflowException

  public boolean passesCondition(Map transientVars, Map args, PropertySet ps) throws WorkflowException {
    Object role = args.get(ROLE);

    if (role == null) {
      throw new WorkflowException("Condition [" + getClass().getName() + "] expects argument [" + ROLE + "].");
    }

    SecurityContext securityContext = (SecurityContext) SecurityContextHolder.getContext();
    GrantedAuthority[] authorities = securityContext.getAuthentication().getAuthorities();
View Full Code Here

Examples of cu.repsystestbed.exceptions.WorkflowException

      {
        Object lastItem = sequence.get(sequence.size() - 1);
       
        if(!(lastItem instanceof Algorithm))
        {
          throw new WorkflowException("Last item was not an algorithm.");
        }
       
        if(!((Algorithm) lastItem).assertGraph2OutputType((Graph) item))
        {
          throw new WorkflowException("Postconditions failed: assertGraph2OutputType()");
        }
       
        ((Algorithm) lastItem).setGraph2Output((Graph) item);
        logger.debug("Adding a graph");
        sequence.add(item);
      }

     
    }
    else if(item instanceof Algorithm)
    {     
      if(sequence.size() < 1)
      {
        throw new WorkflowException("Sequence is empty. First add a graph before adding an algorithm.");
      }
     
      Object lastItem = sequence.get(sequence.size() - 1);     
      Util.assertNotNull(lastItem);
     
      if(!(lastItem instanceof Graph))
      {
        throw new WorkflowException("Last item was not a graph.");
      }
     
      Algorithm alg = (Algorithm) item;
     
      if(!alg.assertGraph2ListenType((Graph) lastItem))
      {
        throw new WorkflowException("Failed preconditions: assertGraph2ListenType()");
      }
     
      alg.setGraph2Listen((Graph) lastItem);
     
      ((Graph) lastItem).addObserver(alg);
     
     
      if(item instanceof EvaluationAlgorithm)
      { 
        Util.assertNotNull(((EvaluationAlgorithm) alg).getWrappedAroundAlg());
      }
 
      logger.debug("Adding an algorithm.");
      sequence.add(item);
     
    }
    else
    {
      throw new WorkflowException("Unknown element. Cannot add.");
    }
   
  }
View Full Code Here

Examples of nexj.core.runtime.WorkflowException

      if (primary != null)
      {
         if (flow.getMetaclass() == null || !flow.getMetaclass().isUpcast(primary.getMetaclass()))
         {
            throw new WorkflowException("err.workflow.invalidClass",
               new Object[]{flow.getName(), primary.getMetaclass().getName()});
         }

         if (primary.getMetaclass().getPersistenceMapping() == null)
         {
View Full Code Here

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

                logger.debug("faultMessage: " + XMLUtil.xmlElementToString((XmlElement) this.faultMessage));
            }
            return this.success;
        } catch (RuntimeException e) {
            String message = "Error in invoking a service.";
            throw new WorkflowException(message, e);
        }
    }
View Full Code Here

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

            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

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

        } 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

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

                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

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);
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.