Package org.kie.api.runtime.manager

Examples of org.kie.api.runtime.manager.RuntimeManager


        logger.info("TEST:Unit {} has been deployed", unit);
        Collection<ProcessDesc> processes = processService.getProcesses();
        assertNotNull(processes);
        assertEquals(2, processes.size());
       
        RuntimeManager manager = processService.getRuntimeManager(unit.getIdentifier());
        assertNotNull(manager);
       
        RuntimeEngine engine = manager.getRuntimeEngine(EmptyContext.get());
        assertNotNull(engine);
       
        KieSession ksession = engine.getKieSession();
        assertNotNull(ksession);
       
View Full Code Here


        logger.info("TEST:Unit {} has been deployed", unit);
        Collection<ProcessDesc> processes = processService.getProcesses();
        assertNotNull(processes);
        assertEquals(2, processes.size());
       
        RuntimeManager manager = processService.getRuntimeManager(unit.getIdentifier());
        assertNotNull(manager);
       
        RuntimeEngine engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get());
        assertNotNull(engine);
       
        KieSession ksession = engine.getKieSession();
        assertNotNull(ksession);
       
View Full Code Here

        logger.info("TEST:Unit {} has been deployed", unit);
        Collection<ProcessDesc> processes = processService.getProcesses();
        assertNotNull(processes);
        assertEquals(2, processes.size());
       
        RuntimeManager manager = processService.getRuntimeManager(unit.getIdentifier());
        assertNotNull(manager);
       
        RuntimeEngine engine = manager.getRuntimeEngine(EmptyContext.get());
        assertNotNull(engine);
       
        KieSession ksession = engine.getKieSession();
        assertNotNull(ksession);
       
View Full Code Here

        logger.info("TEST:Unit {} has been deployed", unit);
        Collection<ProcessDesc> processes = processService.getProcesses();
        assertNotNull(processes);
        assertEquals(2, processes.size());
       
        RuntimeManager manager = processService.getRuntimeManager(unit.getIdentifier());
        assertNotNull(manager);
       
        RuntimeEngine engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get());
        assertNotNull(engine);
       
        KieSession ksession = engine.getKieSession();
        assertNotNull(ksession);
       
        ProcessInstance processInstance = ksession.startProcess("org.jbpm.writedocument");
        manager.disposeRuntimeEngine(engine);
       
        engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get(processInstance.getId()));
        assertNotNull(engine);
       
        ksession = engine.getKieSession();
        assertNotNull(ksession);
       
        // check the state of process instance
        processInstance = ksession.getProcessInstance(processInstance.getId());
        assertNotNull(processInstance);
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
       
        TaskService taskService = engine.getTaskService();
       
        List<TaskSummary> tasks = taskService.getTasksAssignedAsPotentialOwner("salaboy", "en-UK");
        assertNotNull(tasks);
        assertEquals(1, tasks.size());
       
        long taskId = tasks.get(0).getId();
       
        taskService.start(taskId, "salaboy");
        taskService.complete(taskId, "salaboy", null);
       
        manager.disposeRuntimeEngine(engine);
       
        engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get(processInstance.getId()));
        assertNotNull(engine);
       
        ksession = engine.getKieSession();
        assertNotNull(ksession);
       
        taskService = engine.getTaskService();
       
        // check the state of process instance
        processInstance = ksession.getProcessInstance(processInstance.getId());
        assertNotNull(processInstance);
        assertEquals(ProcessInstance.STATE_ACTIVE, processInstance.getState());
       
        try {
            processService.undeployUnit(unit);
            fail("It's not possible to undeploy when there are active process instances");
        } catch (Exception e) {
            // do nothing it's expected
        }
       
        tasks = taskService.getTasksAssignedAsPotentialOwner("translator", "en-UK");
        assertNotNull(tasks);
        assertEquals(1, tasks.size());
       
        taskId = tasks.get(0).getId();
       
        taskService.start(taskId, "translator");
        taskService.complete(taskId, "translator", null);
       
        manager.disposeRuntimeEngine(engine);
       
        engine = manager.getRuntimeEngine(ProcessInstanceIdContext.get(processInstance.getId()));
        assertNotNull(engine);
       
        ksession = engine.getKieSession();
        assertNotNull(ksession);
       
View Full Code Here

TOP

Related Classes of org.kie.api.runtime.manager.RuntimeManager

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.