Package org.fireflow.engine.definition

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


     */
    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

                    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

     * 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

     * 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

     * 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

        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

TOP

Related Classes of org.fireflow.engine.definition.WorkflowDefinition

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.