Package org.fireflow.model

Examples of org.fireflow.model.WorkflowProcess


        String synchronizer1Id = "MyFirstProcess.Synchronizer1";
        String synchronizer2Id = "MyFirstProcess.Synchronizer2";
        InputStream in = Dom4JFPDLParserTest.class.getResourceAsStream("/org/fireflow/model/io/MyFirstProcess.xml");
        Dom4JFPDLParser instance = new Dom4JFPDLParser();

        WorkflowProcess workflowProcess1 = instance.parse(in);
       
        String tmpDir = System.getProperty("java.io.tmpdir");
       
        File f = new File(tmpDir+"MyFirstProcess_tmp.xml");
        FileOutputStream out = new FileOutputStream(f);
        Dom4JFPDLSerializer ser = new Dom4JFPDLSerializer();
        ser.serialize(workflowProcess1, out);
        out.flush();
        out.close();

        FileInputStream fIn= new FileInputStream(f);
        WorkflowProcess result = instance.parse(fIn);
        f.delete();

        assertNotNull(result);

        assertEquals(1, result.getLoops().size());

        Loop loop = (Loop)result.getLoops().get(0);
        assertNotNull(loop.getCondition());

        Synchronizer sync1 = (Synchronizer)result.findWFElementById(synchronizer1Id);
        assertEquals(1,sync1.getEnteringLoops().size());
        assertEquals(0,sync1.getLeavingLoops().size());

        Synchronizer sync2 = (Synchronizer)result.findWFElementById(synchronizer2Id);
        assertEquals(0,sync2.getEnteringLoops().size());
        assertEquals(1,sync2.getLeavingLoops().size());
    }
View Full Code Here


        final String PrepareGoodsActivity_ID = "Goods_Deliver_Process.PrepareGoodsActivity";
        final String PaymentActivity_ID = "Goods_Deliver_Process.PaymentActivity";
        InputStream in = Dom4JFPDLParserTest.class.getResourceAsStream("/org/fireflow/model/io/example_workflow.xml");
        JAXP_FPDL_Parser instance = new JAXP_FPDL_Parser();

        WorkflowProcess workflowProcess1 = instance.parse(in);
       
        String tmpDir = System.getProperty("java.io.tmpdir");
        File f = new File(tmpDir+"example_workflow_tmp.xml");
        FileOutputStream out = new FileOutputStream(f);
        JAXP_FPDL_Serializer ser = new JAXP_FPDL_Serializer();
        ser.serialize(workflowProcess1, out);
        out.flush();
        out.close();

        FileInputStream fIn= new FileInputStream(f);
        WorkflowProcess result = instance.parse(fIn);
        f.delete();
        assertNotNull(result);

        assertNotNull(result.getStartNode());
        assertEquals(1, result.getTasks().size());
        assertEquals(4, result.getActivities().size());
        assertEquals(2, result.getSynchronizers().size());
        assertEquals(1, result.getEndNodes().size());
        assertEquals(8, result.getTransitions().size());

        Activity paymentActivity = (Activity) result.findWFElementById(PaymentActivity_ID);
        assertNotNull(paymentActivity);
        assertEquals(1, paymentActivity.getTasks().size());
        assertEquals(1, paymentActivity.getInlineTasks().size());

        Activity prepareGoodsActivity = (Activity) result.findWFElementById(PrepareGoodsActivity_ID);
        assertNotNull(prepareGoodsActivity);
        assertEquals(1, prepareGoodsActivity.getTasks().size());
        assertEquals(1, prepareGoodsActivity.getTaskRefs().size());

    }
View Full Code Here

        String synchronizer1Id = "MyFirstProcess.Synchronizer1";
        String synchronizer2Id = "MyFirstProcess.Synchronizer2";
        InputStream in = Dom4JFPDLParserTest.class.getResourceAsStream("/org/fireflow/model/io/MyFirstProcess.xml");
        JAXP_FPDL_Parser instance = new JAXP_FPDL_Parser();

        WorkflowProcess workflowProcess1 = instance.parse(in);
       
        String tmpDir = System.getProperty("java.io.tmpdir");
        File f = new File(tmpDir+"MyFirstProcess_tmp.xml");
        FileOutputStream out = new FileOutputStream(f);
        JAXP_FPDL_Serializer ser = new JAXP_FPDL_Serializer();
        ser.serialize(workflowProcess1, out);
        out.flush();
        out.close();

        FileInputStream fIn= new FileInputStream(f);
        WorkflowProcess result = instance.parse(fIn);
        f.delete();

        assertNotNull(result);

        assertEquals(1, result.getLoops().size());

        Loop loop = (Loop)result.getLoops().get(0);
        assertNotNull(loop.getCondition());

        Synchronizer sync1 = (Synchronizer)result.findWFElementById(synchronizer1Id);
        assertEquals(1,sync1.getEnteringLoops().size());
        assertEquals(0,sync1.getLeavingLoops().size());

        Synchronizer sync2 = (Synchronizer)result.findWFElementById(synchronizer2Id);
        assertEquals(0,sync2.getEnteringLoops().size());
        assertEquals(1,sync2.getLeavingLoops().size());
    }
View Full Code Here

        final String PrepareGoodsActivity_ID = "Goods_Deliver_Process.PrepareGoodsActivity";
        final String PaymentActivity_ID = "Goods_Deliver_Process.PaymentActivity";
        InputStream in = Dom4JFPDLParserTest.class.getResourceAsStream("/org/fireflow/model/io/example_workflow.xml");
        Dom4JFPDLParser instance = new Dom4JFPDLParser();

        WorkflowProcess result = instance.parse(in);
        assertNotNull(result);

        assertNotNull(result.getStartNode());
        assertEquals(1, result.getTasks().size());
        assertEquals(4, result.getActivities().size());
        assertEquals(2, result.getSynchronizers().size());
        assertEquals(1, result.getEndNodes().size());
        assertEquals(8, result.getTransitions().size());
       
        Task task = result.getTasks().get(0);
        assertEquals("Goods_Deliver_Process.PrepareGoodsTask",task.getId());

        Activity paymentActivity = (Activity) result.findWFElementById(PaymentActivity_ID);
        assertNotNull(paymentActivity);
        assertEquals(1, paymentActivity.getTasks().size());
        assertEquals(1, paymentActivity.getInlineTasks().size());

        Activity prepareGoodsActivity = (Activity) result.findWFElementById(PrepareGoodsActivity_ID);
        assertNotNull(prepareGoodsActivity);
        assertEquals(1, prepareGoodsActivity.getTasks().size());
        assertEquals(1, prepareGoodsActivity.getTaskRefs().size());
    }
View Full Code Here

        String synchronizer2Id = "MyFirstProcess.Synchronizer2";

        InputStream in = Dom4JFPDLParserTest.class.getResourceAsStream("/org/fireflow/model/io/MyFirstProcess.xml");
        Dom4JFPDLParser instance = new Dom4JFPDLParser();

        WorkflowProcess result = instance.parse(in);

        assertNotNull(result);

        assertEquals(1, result.getLoops().size());

        Loop loop = (Loop)result.getLoops().get(0);
        assertNotNull(loop.getCondition());

        Synchronizer sync1 = (Synchronizer)result.findWFElementById(synchronizer1Id);
        assertEquals(1,sync1.getEnteringLoops().size());
        assertEquals(0,sync1.getLeavingLoops().size());

        Synchronizer sync2 = (Synchronizer)result.findWFElementById(synchronizer2Id);
        assertEquals(0,sync2.getEnteringLoops().size());
        assertEquals(1,sync2.getLeavingLoops().size());
    }
View Full Code Here

        final String PrepareGoodsActivity_ID = "Goods_Deliver_Process.PrepareGoodsActivity";
        final String PaymentActivity_ID = "Goods_Deliver_Process.PaymentActivity";
        InputStream in = Dom4JFPDLParserTest.class.getResourceAsStream("/org/fireflow/model/io/example_workflow.xml");
        JAXP_FPDL_Parser instance = new JAXP_FPDL_Parser();

        WorkflowProcess result = instance.parse(in);
        assertNotNull(result);

        assertNotNull(result.getStartNode());
        assertEquals(1, result.getTasks().size());
        assertEquals(4, result.getActivities().size());
        assertEquals(2, result.getSynchronizers().size());
        assertEquals(1, result.getEndNodes().size());
        assertEquals(8, result.getTransitions().size());
       
        Task task = result.getTasks().get(0);
        assertEquals("Goods_Deliver_Process.PrepareGoodsTask",task.getId());
       
        Activity paymentActivity = (Activity) result.findWFElementById(PaymentActivity_ID);
        assertNotNull(paymentActivity);
        assertEquals(1, paymentActivity.getTasks().size());
        assertEquals(1, paymentActivity.getInlineTasks().size());

        Activity prepareGoodsActivity = (Activity) result.findWFElementById(PrepareGoodsActivity_ID);
        assertNotNull(prepareGoodsActivity);
        assertEquals(1, prepareGoodsActivity.getTasks().size());
        assertEquals(1, prepareGoodsActivity.getTaskRefs().size());
    }
View Full Code Here

        String synchronizer2Id = "MyFirstProcess.Synchronizer2";

        InputStream in = Dom4JFPDLParserTest.class.getResourceAsStream("/org/fireflow/model/io/MyFirstProcess.xml");
        JAXP_FPDL_Parser instance = new JAXP_FPDL_Parser();

        WorkflowProcess result = instance.parse(in);

        assertNotNull(result);

        assertEquals(1, result.getLoops().size());

        Loop loop = (Loop)result.getLoops().get(0);
        assertNotNull(loop.getCondition());

        Synchronizer sync1 = (Synchronizer)result.findWFElementById(synchronizer1Id);
        assertEquals(1,sync1.getEnteringLoops().size());
        assertEquals(0,sync1.getLeavingLoops().size());

        Synchronizer sync2 = (Synchronizer)result.findWFElementById(synchronizer2Id);
        assertEquals(0,sync2.getEnteringLoops().size());
        assertEquals(1,sync2.getLeavingLoops().size());
    }
View Full Code Here

        final String PrepareGoodsActivity_ID = "Goods_Deliver_Process.PrepareGoodsActivity";
        final String PaymentActivity_ID = "Goods_Deliver_Process.PaymentActivity";
        InputStream in = Dom4JFPDLParserTest.class.getResourceAsStream("/org/fireflow/model/io/example_workflow.xml");
        Dom4JFPDLParser instance = new Dom4JFPDLParser();

        WorkflowProcess workflowProcess1 = instance.parse(in);
       
        String tmpDir = System.getProperty("java.io.tmpdir");
       
        File f = new File(tmpDir+"example_workflow_tmp.xml");
        FileOutputStream out = new FileOutputStream(f);
        Dom4JFPDLSerializer ser = new Dom4JFPDLSerializer();
        ser.serialize(workflowProcess1, out);
        out.flush();
        out.close();

        FileInputStream fIn= new FileInputStream(f);
        WorkflowProcess result = instance.parse(fIn);
        f.delete();
        assertNotNull(result);

        assertNotNull(result.getStartNode());
        assertEquals(1, result.getTasks().size());
        assertEquals(4, result.getActivities().size());
        assertEquals(2, result.getSynchronizers().size());
        assertEquals(1, result.getEndNodes().size());
        assertEquals(8, result.getTransitions().size());

        Activity paymentActivity = (Activity) result.findWFElementById(PaymentActivity_ID);
        assertNotNull(paymentActivity);
        assertEquals(1, paymentActivity.getTasks().size());
        assertEquals(1, paymentActivity.getInlineTasks().size());

        Activity prepareGoodsActivity = (Activity) result.findWFElementById(PrepareGoodsActivity_ID);
        assertNotNull(prepareGoodsActivity);
        assertEquals(1, prepareGoodsActivity.getTasks().size());
        assertEquals(1, prepareGoodsActivity.getTaskRefs().size());

    }
View Full Code Here

                if (workflowProcessFileNames != null) {
                    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);
View Full Code Here

    }
    if (taskInstanceRunner != null) {
      taskInstanceRunner.run(currentSession, this.rtCtx, processInstance,
          taskInstance);
    } else {
      WorkflowProcess process = taskInstance.getWorkflowProcess();
      throw new EngineException(taskInstance.getProcessInstanceId(),
          process, taskInstance.getTaskId(),
          "无法获取TaskInstanceRunner,TaskId=" + task.getId()
              + ", taskType=" + taskInstance.getTaskType());
    }
View Full Code Here

TOP

Related Classes of org.fireflow.model.WorkflowProcess

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.