Examples of Workflow


Examples of Galaxy.Tree.Workflow.Workflow

  }
  /**
   * Convert a Pipeline to a Galaxy Workflow
   */
  public Object visit(Pipeline pipeline) {
    Workflow workflow;
    ModuleGroup mgroup = pipeline.getPipelineModuleGroup();
    Connections conns = pipeline.getConnections();
    GalaxyContext context=  new GalaxyContext();
    context.getDatabase().clear();
    NODE_COUNT = 0;
   
    //convert the module group
    Pair<List<Step>, Object> mystp = moduleVisitor.visit(mgroup, context);
   
    /* Visit connections */
    List<Pair<Pair<Integer,String>, InputConnection>> connlist;
    connlist = (List<Pair<Pair<Integer,String>, InputConnection>>) visit(conns, context).getElem1();
   
    /* Add resulting connections */
    for(Pair<Pair<Integer,String>, InputConnection> myconn : connlist){
      for(Step mystep : mystp.getElem1()){
        if(mystep.getId() == myconn.getElem1().getElem1().intValue()){
          mystep.getConnections().put(
              myconn.getElem1().getElem2(), myconn.getElem2());
        }
      }
    }
    //create workflow from modulegroup, connections
    workflow = new Workflow(mgroup.getName(),
        mgroup.getDescription(),
        pipeline.getVersion(),
        true);
    //add steps retrieved from visiting modulegroup.
    for(Step s : mystp.getElem1())
      workflow.addStep(s.getId(), s);
    return workflow;
  }
View Full Code Here

Examples of Taverna.Tree.Workflow

  /**
   * Converts a Loni Pipeline Workflow into corresponding Taverna Workflow object.
   */
  public Object visit(Pipeline pipeline){
    this.pipeline = pipeline;
    Workflow workflow;
    String producedBy="taverna-2.3.0";
    String version = "1";    //Taverna wouldn't open the file with the version less than 1
    String xmlns="http://taverna.sf.net/2008/xml/t2flow";
   
    Dataflow dataflow = (Dataflow) visit(pipeline.getPipelineModuleGroup());
    workflow = new Workflow( dataflow,  producedBy,  version,  xmlns);
    this.workflow = workflow;
    return workflow;

  }
View Full Code Here

Examples of com.agiletec.plugins.jpcontentworkflow.aps.system.services.workflow.model.Workflow

    this._helper.resetWorkflowConfig();
    super.tearDown();
  }
 
  public void testGetWorkflow() {
    Workflow workflow = this._workflowManager.getWorkflow("ART");
    assertEquals("ART", workflow.getTypeCode());
    assertNull(workflow.getRole());
    List<Step> steps = workflow.getSteps();
    assertEquals(3, steps.size());
    Step step1 = workflow.getStep("step1");
    assertEquals("step1", step1.getCode());
    assertEquals("Step 1", step1.getDescr());
    assertEquals("pageManager", step1.getRole());
   
    Step step2 = workflow.getStep("step2");
    assertEquals("step2", step2.getCode());
    assertEquals("Step 2", step2.getDescr());
    assertNull(step2.getRole());
   
    Step step3 = workflow.getStep("step3");
    assertEquals("step3", step3.getCode());
    assertEquals("Step 3", step3.getDescr());
    assertEquals("supervisor", step3.getRole());
   
    Workflow workflow2 = this._workflowManager.getWorkflow("EVN");
    assertEquals("pageManager", workflow2.getRole());
    assertEquals(0, workflow2.getSteps().size());
   
    assertNotNull(this._workflowManager.getWorkflow("RAH"));
  }
View Full Code Here

Examples of com.amazonaws.services.simpleworkflow.flow.annotations.Workflow

        return workflowImplementationTypes;
    }

    private void addWorkflowType(Class<?> interfaze, Class<?> workflowImplementationType, DataConverter converterOverride)
            throws InstantiationException, IllegalAccessException {
        Workflow workflowAnnotation = interfaze.getAnnotation(Workflow.class);
        String interfaceName = interfaze.getSimpleName();
        MethodConverterPair workflowImplementationMethod = null;
        MethodConverterPair getStateMethod = null;
        WorkflowType workflowType = null;
        WorkflowTypeRegistrationOptions registrationOptions = null;
        Map<String, MethodConverterPair> signals = new HashMap<String, MethodConverterPair>();
        for (Method method : interfaze.getMethods()) {
            if (method.getDeclaringClass().getAnnotation(Workflow.class) == null) {
                continue;
            }
            Execute executeAnnotation = method.getAnnotation(Execute.class);
            Signal signalAnnotation = method.getAnnotation(Signal.class);
            GetState getStateAnnotation = method.getAnnotation(GetState.class);
            checkAnnotationUniqueness(method, executeAnnotation, signalAnnotation, getStateAnnotation);
            if (executeAnnotation != null) {
                if (workflowImplementationMethod != null) {
                    throw new IllegalArgumentException(
                            "Interface annotated with @Workflow is allowed to have only one method annotated with @Execute. Found "
                                    + getMethodFullName(workflowImplementationMethod.getMethod()) + " and "
                                    + getMethodFullName(method));
                }
                if (!method.getReturnType().equals(void.class) && !(Promise.class.isAssignableFrom(method.getReturnType()))) {
                    throw new IllegalArgumentException(
                            "Workflow implementation method annotated with @Execute can return only Promise or void: "
                                    + getMethodFullName(method));
                }
                if (!method.getDeclaringClass().equals(interfaze)) {
                    throw new IllegalArgumentException("Interface " + interfaze.getName()
                            + " cannot inherit workflow implementation method annotated with @Execute: "
                            + getMethodFullName(method));

                }
                DataConverter converter = createConverter(workflowAnnotation.dataConverter(), converterOverride);
                workflowImplementationMethod = new MethodConverterPair(method, converter);
                workflowType = getWorkflowType(interfaceName, method, executeAnnotation);
               
                WorkflowRegistrationOptions registrationOptionsAnnotation = interfaze.getAnnotation(WorkflowRegistrationOptions.class);
                SkipTypeRegistration skipRegistrationAnnotation = interfaze.getAnnotation(SkipTypeRegistration.class);
                if (skipRegistrationAnnotation == null) {
                    if (registrationOptionsAnnotation == null) {
                        throw new IllegalArgumentException(
                                "@WorkflowRegistrationOptions is required for the interface that contains method annotated with @Execute");
                    }
                    registrationOptions = createRegistrationOptions(registrationOptionsAnnotation);
                }
                else {
                    if (registrationOptionsAnnotation != null) {
                        throw new IllegalArgumentException(
                                "@WorkflowRegistrationOptions is not allowed for the interface annotated with @SkipTypeRegistration.");
                    }
                }
            }
            if (signalAnnotation != null) {
                String signalName = signalAnnotation.name();
                if (signalName == null || signalName.isEmpty()) {
                    signalName = method.getName();
                }
                DataConverter signalConverter = createConverter(workflowAnnotation.dataConverter(), converterOverride);
                signals.put(signalName, new MethodConverterPair(method, signalConverter));
            }
            if (getStateAnnotation != null) {
                if (getStateMethod != null) {
                    throw new IllegalArgumentException(
                            "Interface annotated with @Workflow is allowed to have only one method annotated with @GetState. Found "
                                    + getMethodFullName(getStateMethod.getMethod()) + " and " + getMethodFullName(method));
                }
                if (method.getReturnType().equals(void.class) || (Promise.class.isAssignableFrom(method.getReturnType()))) {
                    throw new IllegalArgumentException(
                            "Workflow method annotated with @GetState cannot have void or Promise return type: "
                                    + getMethodFullName(method));
                }
                DataConverter converter = createConverter(workflowAnnotation.dataConverter(), converterOverride);
                getStateMethod = new MethodConverterPair(method, converter);
            }
        }
        if (workflowImplementationMethod == null) {
            throw new IllegalArgumentException("Workflow definition does not implement any method annotated with @Execute. "
View Full Code Here

Examples of com.asakusafw.compiler.batch.Workflow

                extraResources,
                serviceClassLoader,
                flowCompilerOptions);

        BatchCompiler compiler = new BatchCompiler(config);
        Workflow workflow = compiler.compile(driver.getBatchClass().getDescription());
        return toInfo(workflow, outputDirectory);
    }
View Full Code Here

Examples of com.day.cq.workflow.exec.Workflow

                if (StringUtils.isBlank(state)
                        && StringUtils.isNotBlank(payloadPath)) {

                    // Don't try to restart already processed batch items

                    final Workflow workflow = workflowSession.startWorkflow(model,
                            workflowSession.newWorkflowData("JCR_PATH", payloadPath));
                    properties.put(KEY_WORKFLOW_ID, workflow.getId());
                    properties.put(KEY_STATE, workflow.getState());

                    workflowMap.put(child.getPath(), workflow.getId());
                }
            }
        } else {
            log.error("Cant find the current batch to process.");
        }
View Full Code Here

Examples of com.ecyrd.jspwiki.workflow.Workflow

        @Override
        public Outcome execute() throws WikiException
        {
            // Retrieve attributes
            WikiEngine engine = m_context.getEngine();
            Workflow workflow = getWorkflow();

            // Get the wiki page
            WikiPage page = m_context.getPage();

            // Figure out who the author was. Prefer the author
            // set programmatically; otherwise get from the
            // current logged in user
            if ( page.getAuthor() == null )
            {
                Principal wup = m_context.getCurrentUser();

                if ( wup != null )
                    page.setAuthor( wup.getName() );
            }

            // Run the pre-save filters. If any exceptions, add error to list, abort, and redirect
            String saveText;
            try
            {
                saveText = engine.getFilterManager().doPreSaveFiltering( m_context, m_proposedText );
            }
            catch ( FilterException e )
            {
                throw e;
            }

            // Stash the wiki context, old and new text as workflow attributes
            workflow.setAttribute( PRESAVE_WIKI_CONTEXT, m_context );
            workflow.setAttribute( FACT_PROPOSED_TEXT, saveText );
            return Outcome.STEP_COMPLETE;
        }
View Full Code Here

Examples of com.opensymphony.workflow.Workflow

      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n\r\n");

    Workflow wf = new BasicWorkflow((String) session.getAttribute("username"));
    long id = wf.createEntry("example");
    //out.println(id);
  wf.initialize(id, 1, null);
      out.write("\r\n\r\nNew workflow entry ");
      out.write("<a href=\"test.jsp?id=");
      out.print(id);
      out.write("\">#");
      out.print(id);
View Full Code Here

Examples of com.opensymphony.workflow.Workflow

      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");

    Workflow wf = new BasicWorkflow((String) session.getAttribute("username"));

    long id = Long.parseLong(request.getParameter("id"));

    String doString = request.getParameter("do");
    if (doString != null && !doString.equals("")) {
        int action = Integer.parseInt(doString);
        wf.doAction(id, action, Collections.EMPTY_MAP);
    }


    int[] actions = wf.getAvailableActions(id);

    for (int i = 0; i < actions.length; i++) {
        String name = wf.getActionName("example", actions[i]);
              out.write("\r\n        ");
      out.write("<li> ");
      out.write("<a href=\"test.jsp?id=");
      out.print(id);
      out.write("&do=");
      out.print( actions[i] );
      out.write("\">");
      out.print( name );
      out.write("</a>\r\n        ");

    }
      out.write("\r\n\r\n");
      out.write("<hr>\r\n");
      out.write("<b>Permissions");
      out.write("</b>\r\n");
      out.write("<p>\r\n\r\n");

    List perms = wf.getSecurityPermissions(id);
    for (Iterator iterator = perms.iterator(); iterator.hasNext();) {
        String perm = (String) iterator.next();
      out.write("\r\n    ");
      out.write("<li>");
      out.print( perm );
View Full Code Here

Examples of com.opensymphony.workflow.Workflow

   * Injects the type resolver (if available) inside the workflow.
   *
   * @see org.springmodules.workflow.osworkflow.OsWorkflowTemplate#createWorkflow(java.lang.String)
   */
  protected Workflow createWorkflow(String caller) throws WorkflowException {
    Workflow workflow = super.createWorkflow(caller);
    if (typeResolver != null) {
      // inject the type resolver if there is such a case
      if (workflow instanceof AbstractWorkflow) {
        ((AbstractWorkflow) workflow).setResolver(typeResolver);
      }
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.