Package org.jbpm.simulation.impl

Examples of org.jbpm.simulation.impl.WorkingMemorySimulationRepository


       
        PathFinder finder = PathFinderFactory.getInstance(this.getClass().getResourceAsStream("/BPMN2-UserTask.bpmn2"));
       
        List<SimulationPath> paths = finder.findPaths(new SimulationFilterPathFormatConverter());
        SimulationContext context = SimulationContextFactory.newContext(new HardCodedSimulationDataProvider()
        , new WorkingMemorySimulationRepository(true, "printOutRule.drl"));
       
       
        for (SimulationPath path : paths) {
           
            context.setCurrentPath(path);
View Full Code Here


       
        PathFinder finder = PathFinderFactory.getInstance(this.getClass().getResourceAsStream("/BPMN2-TwoUserTasks.bpmn2"));
       
        List<SimulationPath> paths = finder.findPaths(new SimulationFilterPathFormatConverter());
        SimulationContext context = SimulationContextFactory.newContext(new BPMN2SimulationDataProvider(this.getClass().getResourceAsStream("/BPMN2-TwoUserTasks.bpmn2"))
        , new WorkingMemorySimulationRepository("default.simulation.rules.drl"));

       
        for (int i =0; i < 5; i++ ){

            for (SimulationPath path : paths) {
View Full Code Here

       
        SimulationRepository repo = SimulationRunner.runSimulation("BPMN2-TwoUserTasks", out, 10, 2000, "default.simulation.rules.drl");
        assertNotNull(repo);
       
        WorkingMemorySimulationRepository wmRepo = (WorkingMemorySimulationRepository) repo;
        wmRepo.fireAllRules();
       
        assertEquals(4, wmRepo.getAggregatedEvents().size());
        assertEquals(50, wmRepo.getEvents().size());
       
        AggregatedSimulationEvent event = wmRepo.getAggregatedEvents().get(0);
        if (event instanceof AggregatedEndEventSimulationEvent) {
            assertNotNull(event.getProperty("minProcessDuration"));
            assertFalse(event.getProperty("activityId").equals(""));
        }
       
        event = wmRepo.getAggregatedEvents().get(1);
        assertFalse(event.getProperty("activityId").equals(""));
        assertNotNull(event.getProperty("minExecutionTime"));
        event = wmRepo.getAggregatedEvents().get(2);
        assertFalse(event.getProperty("activityId").equals(""));
        assertNotNull(event.getProperty("minExecutionTime"));
       
        event = wmRepo.getAggregatedEvents().get(3);
        assertNotNull(event.getProperty("minExecutionTime"));
        wmRepo.close();
       
    }
View Full Code Here

       
        SimulationRepository repo = SimulationRunner.runSimulation("defaultPackage.test", out, 10, 2000, "default.simulation.rules.drl");
        assertNotNull(repo);
       
        WorkingMemorySimulationRepository wmRepo = (WorkingMemorySimulationRepository) repo;
        wmRepo.fireAllRules();
        assertEquals(5, wmRepo.getAggregatedEvents().size());
        assertEquals(70, wmRepo.getEvents().size());
       
        List<AggregatedSimulationEvent> aggEvents = wmRepo.getAggregatedEvents();
        for (AggregatedSimulationEvent event : aggEvents) {
            if (event instanceof AggregatedProcessSimulationEvent) {
                Map<String, Integer> numberOfInstancePerPath = ((AggregatedProcessSimulationEvent) event).getPathNumberOfInstances();
                assertNotNull(numberOfInstancePerPath);
                assertTrue(3 == numberOfInstancePerPath.get("Path800898475-0"));
                assertTrue(7 == numberOfInstancePerPath.get("Path-960633761-1"));
            }
        }
        wmRepo.close();
    }
View Full Code Here

       
        SimulationRepository repo = SimulationRunner.runSimulation("defaultPackage.test", out, 1, 2000, "default.simulation.rules.drl");
        assertNotNull(repo);
       
        WorkingMemorySimulationRepository wmRepo = (WorkingMemorySimulationRepository) repo;
        wmRepo.fireAllRules();
        assertEquals(4, wmRepo.getAggregatedEvents().size());
        assertEquals(7, wmRepo.getEvents().size());
        wmRepo.close();
    }
View Full Code Here

       
        SimulationRepository repo = SimulationRunner.runSimulation("defaultPackage.test", out, 2, 2000, "default.simulation.rules.drl");
        assertNotNull(repo);
       
        WorkingMemorySimulationRepository wmRepo = (WorkingMemorySimulationRepository) repo;
        wmRepo.fireAllRules();
        assertEquals(5, wmRepo.getAggregatedEvents().size());
        assertEquals(14, wmRepo.getEvents().size());
        wmRepo.close();
    }
View Full Code Here

       
        SimulationRepository repo = SimulationRunner.runSimulation("defaultPackage.test", out, 5, 2000, true, "default.simulation.rules.drl");
        assertNotNull(repo);
       
        WorkingMemorySimulationRepository wmRepo = (WorkingMemorySimulationRepository) repo;

        assertEquals(20, wmRepo.getAggregatedEvents().size());
        assertEquals(35, wmRepo.getEvents().size());
        wmRepo.close();
    }
View Full Code Here

            out += line;

        SimulationRepository repo = SimulationRunner.runSimulation("defaultPackage.banl-loan", out, 10, 100, true, "onevent.simulation.rules.drl");
        assertNotNull(repo);

        WorkingMemorySimulationRepository wmRepo = (WorkingMemorySimulationRepository) repo;
        wmRepo.getSession().execute(new InsertElementsCommand((Collection)wmRepo.getAggregatedEvents()));
        wmRepo.fireAllRules();

        List<AggregatedSimulationEvent> summary = (List<AggregatedSimulationEvent>) wmRepo.getGlobal("summary");
        assertNotNull(summary);
        assertEquals(12, summary.size());
        assertEquals(102, wmRepo.getEvents().size());

        wmRepo.close();

    }
View Full Code Here

TOP

Related Classes of org.jbpm.simulation.impl.WorkingMemorySimulationRepository

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.