Examples of WorkflowDefinition


Examples of org.fireflow.engine.definition.WorkflowDefinition

    /* (non-Javadoc)
     * @see org.fireflow.engine.ITaskInstance#getWorkflowProcess()
     */
    public WorkflowProcess getWorkflowProcess() throws EngineException {
        WorkflowDefinition workflowDef = rtCtx.getDefinitionService().getWorkflowDefinitionByProcessIdAndVersionNumber(this.getProcessId(), this.getVersion());
        if (workflowDef == null) {
            return null;
        }

        return workflowDef.getWorkflowProcess();
    }
View Full Code Here

Examples of org.fireflow.engine.definition.WorkflowDefinition

     */
    public INetInstance getNetInstance(String processId, Integer version) throws KernelException {
        INetInstance netInstance = this.netInstanceMap.get(processId + "_V_" + version);
        if (netInstance == null) {
          //数据流定义在runtimeContext初始化的时候,就被加载了,将流程定义的xml读入到内存中
            WorkflowDefinition def = rtCtx.getDefinitionService().getWorkflowDefinitionByProcessIdAndVersionNumber(processId, version);
            netInstance = this.createNetInstance(def);
        }
        return netInstance;
    }
View Full Code Here

Examples of org.fireflow.engine.definition.WorkflowDefinition

                    Dom4JFPDLParser parser = new Dom4JFPDLParser();
                    for (int i = 0; i < workflowProcessFileNames.size(); i++) {
                        try {
                            InputStream inStream = this.getClass().getResourceAsStream(workflowProcessFileNames.get(i).trim());
                            WorkflowProcess workflowProcess = parser.parse(inStream);
                            WorkflowDefinition workflowDef = new WorkflowDefinition();
                            workflowDef.setWorkflowProcess(workflowProcess);
                            ids.add(workflowProcess.getId());
                            persistenceService.saveOrUpdateWorkflowDefinition(workflowDef);
                        } catch (IOException ex) {
                            Logger.getLogger(PersistenceServiceHibernateImplTest.class.getName()).log(Level.SEVERE, null, ex);
                        } catch (FPDLParserException ex) {
                            Logger.getLogger(PersistenceServiceHibernateImplTest.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    }
                }
                return ids;
            }

        });
        assertNotNull(workflowProcessIds);
        assertEquals(2,workflowProcessIds.size());
        Goods_Deliver_Process_ID = workflowProcessIds.get(0);
        JumpTo_ID = workflowProcessIds.get(1);

        WorkflowDefinition def1 = persistenceService.findTheLatestVersionOfWorkflowDefinitionByProcessId(Goods_Deliver_Process_ID);
        assertNotNull(def1);
        workflowDefinitionId4Goods_Deliver_Process_ID = def1.getId();
        theLatestVersionNumber4Goods_Deliver_Process_ID = def1.getVersion();
        System.out.println("The latest version number of "+Goods_Deliver_Process_ID+" is "+def1.getVersion());
        System.out.println("======================The workflow process is ===========");
        System.out.println(def1.getProcessContent());
        assertNotNull(def1.getWorkflowProcess());
        assertEquals(Goods_Deliver_Process_ID,def1.getWorkflowProcess().getId());

        WorkflowDefinition def2 = persistenceService.findTheLatestVersionOfWorkflowDefinitionByProcessId(JumpTo_ID);
        assertNotNull(def2);
        System.out.println("The latest version number of "+JumpTo_ID+" is "+def2.getVersion());
        System.out.println("======================The workflow process is ===========");
        System.out.println(def2.getProcessContent());       
        assertNotNull(def2.getWorkflowProcess());
        assertEquals(JumpTo_ID,def2.getWorkflowProcess().getId());       
    }
View Full Code Here

Examples of org.fireflow.engine.definition.WorkflowDefinition

     * Test of findWorkflowDefinitionById method, of class PersistenceServiceHibernateImpl.
     */
    @Test
    public void testFindWorkflowDefinitionById() {
        System.out.println("--------findWorkflowDefinitionById--------");
        WorkflowDefinition workflowDef = persistenceService.findWorkflowDefinitionById(this.workflowDefinitionId4Goods_Deliver_Process_ID);
        assertNotNull(workflowDef);
        assertEquals(this.theLatestVersionNumber4Goods_Deliver_Process_ID,workflowDef.getVersion());
        assertEquals(this.Goods_Deliver_Process_ID,workflowDef.getWorkflowProcess().getId());
    }
View Full Code Here

Examples of org.fireflow.engine.definition.WorkflowDefinition

     * Test of findWorkflowDefinitionByProcessIdAndVersion method, of class PersistenceServiceHibernateImpl.
     */
    @Test
    public void testFindWorkflowDefinitionByProcessIdAndVersionNumber() {
        System.out.println("--------findWorkflowDefinitionByProcessIdAndVersion--------");
        WorkflowDefinition workflowDef = persistenceService.findWorkflowDefinitionByProcessIdAndVersionNumber(this.Goods_Deliver_Process_ID,theLatestVersionNumber4Goods_Deliver_Process_ID);
        assertNotNull(workflowDef);
        assertEquals(this.theLatestVersionNumber4Goods_Deliver_Process_ID,workflowDef.getVersion());
        assertEquals(this.Goods_Deliver_Process_ID,workflowDef.getWorkflowProcess().getId());
    }
View Full Code Here

Examples of org.fireflow.engine.definition.WorkflowDefinition

     * Test of findLatestVersionOfWorkflowDefinitionByProcessId method, of class PersistenceServiceHibernateImpl.
     */
    @Test
    public void testFindLatestVersionOfWorkflowDefinitionByProcessId() {
        System.out.println("--------findLatestVersionOfWorkflowDefinitionByProcessId--------");
        WorkflowDefinition workflowDef = persistenceService.findTheLatestVersionOfWorkflowDefinitionByProcessId(this.Goods_Deliver_Process_ID);
        assertNotNull(workflowDef);
        assertEquals(this.theLatestVersionNumber4Goods_Deliver_Process_ID,workflowDef.getVersion());
        assertEquals(this.Goods_Deliver_Process_ID,workflowDef.getWorkflowProcess().getId());
    }
View Full Code Here

Examples of org.fireflow.engine.definition.WorkflowDefinition

        System.out.println("--------findAllLatestVersionOfWorkflowDefinition--------");
        List workflowDefList = persistenceService.findAllTheLatestVersionsOfWorkflowDefinition();
        assertNotNull(workflowDefList);
        assertEquals(2,workflowDefList.size());
        for (int i=0;i<workflowDefList.size();i++){
            WorkflowDefinition workflowDef = (WorkflowDefinition)workflowDefList.get(i);
            if (this.Goods_Deliver_Process_ID.equals(workflowDef.getProcessId())){
                assertEquals(this.theLatestVersionNumber4Goods_Deliver_Process_ID,workflowDef.getVersion());
            }
            System.out.println("Find workflow definition id="+workflowDef.getProcessId()+" and version="+workflowDef.getVersion());

        }
    }
View Full Code Here

Examples of org.infoglue.cms.entities.workflow.WorkflowDefinition

    try
    {
      beginTransaction(db);

      WorkflowDefinition workflowDefinition = getWorkflowDefinitionWithName(name, db);
      if(workflowDefinition != null)
        workflowDefinitionVO = workflowDefinition.getValueObject();

      commitTransaction(db);
    }
    catch (Exception e)
    {
View Full Code Here

Examples of org.jahia.services.workflow.WorkflowDefinition

        Map<PublicationWorkflow, WorkflowDefinition> result = new LinkedHashMap<PublicationWorkflow, WorkflowDefinition>();

        Map<String,WorkflowDefinition> workflows = new HashMap<String,WorkflowDefinition>();
        for (String wf : keys) {
            WorkflowDefinition w = workflowService.getWorkflowDefinition(StringUtils.substringBefore(wf,":"), StringUtils.substringAfter(wf,":"),null);
            workflows.put(wf, w);
        }

        for (Map.Entry<String, List<GWTJahiaPublicationInfo>> entry : infosListByWorflowGroup.entrySet()) {
            result.put(new PublicationWorkflow(entry.getValue()),workflows.get(workflowGroupToKey.get(entry.getKey())));
View Full Code Here

Examples of org.jahia.services.workflow.WorkflowDefinition

        String workspace = (String) execution.getVariable("workspace");
        String userKey = (String) execution.getVariable("user");

        // try to get some user who did an action on the workflow for the last time
        try {
            WorkflowDefinition def = (WorkflowDefinition) execution.getVariable("workflow");
            List<HistoryWorkflowTask> list = WorkflowService.getInstance().getHistoryWorkflowTasks(((ExecutionImpl) execution).getProcessInstance().getId(), def.getProvider(), Locale.getDefault());
            if (list.size() > 0) {
                userKey = list.get(list.size()-1).getUser();
            }
        } catch (Exception e) {
            logger.error("Cannot get last user on the workflow",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.