本文整理汇总了Java中org.kie.api.runtime.manager.RuntimeManager.disposeRuntimeEngine方法的典型用法代码示例。如果您正苦于以下问题:Java RuntimeManager.disposeRuntimeEngine方法的具体用法?Java RuntimeManager.disposeRuntimeEngine怎么用?Java RuntimeManager.disposeRuntimeEngine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.kie.api.runtime.manager.RuntimeManager
的用法示例。
在下文中一共展示了RuntimeManager.disposeRuntimeEngine方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDeleteProcess
import org.kie.api.runtime.manager.RuntimeManager; //导入方法依赖的package包/类
@Test
public void testDeleteProcess() {
RuntimeManager manager = createRuntimeManager("approval.bpmn");
RuntimeEngine engine = getRuntimeEngine(null);
KieSession ksession = engine.getKieSession();
KieRuntimeLogger log = KieServices.Factory.get().getLoggers().newThreadedFileLogger(ksession, "test", 1000);
ksession.getWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler());
TaskService taskService = engine.getTaskService();
long processInstanceId = startProcess(ksession, taskService);
callDelete(taskService);
assertProcessInstanceCompleted(processInstanceId);
System.out.println("Process instance completed");
log.close();
manager.disposeRuntimeEngine(engine);
manager.close();
}
示例2: doTest
import org.kie.api.runtime.manager.RuntimeManager; //导入方法依赖的package包/类
@Test
public void doTest() {
try {
KieBase kbase = getKieBase(URL, USER, PASSWORD);
RuntimeManager manager = getRuntimeManager(kbase);
RuntimeEngine runtime = manager.getRuntimeEngine(EmptyContext.get());
KieSession ksession = runtime.getKieSession();
ksession.startProcess("test.proc_ht");
// "sales-rep" reviews request
TaskService taskService = runtime.getTaskService();
long taskId = taskService.getTasksAssignedAsPotentialOwner(TASK_USER, "en-UK").get(0).getId();
taskService.claim(taskId, TASK_USER);
taskService.start(taskId, TASK_USER);
taskService.complete(taskId, TASK_USER, null);
System.out.println("Process instance completed");
manager.disposeRuntimeEngine(runtime);
} catch (Throwable t) {
t.printStackTrace();
}
System.exit(0);
}
示例3: doTest
import org.kie.api.runtime.manager.RuntimeManager; //导入方法依赖的package包/类
@Test
public void doTest() {
try {
RuntimeManager manager = getRuntimeManager("org/jugvale/bpms/local/processes/humantask/HumanTask.bpmn");
RuntimeEngine runtime = manager.getRuntimeEngine(EmptyContext.get());
KieSession ksession = runtime.getKieSession();
ksession.startProcess("test.proc_ht");
// "sales-rep" reviews request
TaskService taskService = runtime.getTaskService();
long taskId = taskService.getTasksAssignedAsPotentialOwner(USER, "en-UK").get(0).getId();
taskService.claim(taskId, USER);
taskService.start(taskId, USER);
taskService.complete(taskId, USER, null);
System.out.println("Process instance completed");
manager.disposeRuntimeEngine(runtime);
} catch (Throwable t) {
t.printStackTrace();
}
System.exit(0);
}
示例4: testEvaluationProcess
import org.kie.api.runtime.manager.RuntimeManager; //导入方法依赖的package包/类
@Test
public void testEvaluationProcess() {
RuntimeManager manager = createRuntimeManager("approval.bpmn");
RuntimeEngine engine = getRuntimeEngine(null);
KieSession ksession = engine.getKieSession();
KieRuntimeLogger log = KieServices.Factory.get().getLoggers().newThreadedFileLogger(ksession, "test", 1000);
ksession.getWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler());
TaskService taskService = engine.getTaskService();
long processInstanceId = startProcess(ksession, taskService);
approveTask(taskService, "userA", "userB");
assertNodeTriggered(processInstanceId, "notify next approver");
List<TaskSummary> tasks = taskService.getTasksOwned("userB", "en-UK");
assertEquals(1, tasks.size());
approveTask(taskService, "userB", "userC");
assertNodeTriggered(processInstanceId, "notify next approver");
tasks = taskService.getTasksOwned("userC", "en-UK");
assertEquals(1, tasks.size());
approveTask(taskService, "userC", "userD");
tasks = taskService.getTasksOwned("userD", "en-UK");
assertEquals(1, tasks.size());
approveTask(taskService, "userD", null);
assertNodeTriggered(processInstanceId, "authorised");
System.out.println("Process instance completed");
log.close();
manager.disposeRuntimeEngine(engine);
manager.close();
}
示例5: testRejectAbortProcess
import org.kie.api.runtime.manager.RuntimeManager; //导入方法依赖的package包/类
@Test
public void testRejectAbortProcess() {
RuntimeManager manager = createRuntimeManager("approval.bpmn");
RuntimeEngine engine = getRuntimeEngine(null);
KieSession ksession = engine.getKieSession();
KieRuntimeLogger log = KieServices.Factory.get().getLoggers().newThreadedFileLogger(ksession, "test", 1000);
ksession.getWorkItemManager().registerWorkItemHandler("Send Task", new SendTaskHandler());
TaskService taskService = engine.getTaskService();
long processInstanceId = startProcess(ksession, taskService);
approveTask(taskService, "userA", "userB");
assertNodeTriggered(processInstanceId, "notify next approver");
List<TaskSummary> tasks = taskService.getTasksOwned("userB", "en-UK");
assertEquals(1, tasks.size());
rejectTask(taskService, "userB", "userC");
assertNodeTriggered(processInstanceId, "notify originator");
tasks = taskService.getTasksOwned("userC", "en-UK");
assertEquals(1, tasks.size());
TaskSummary taskSummary = tasks.get(0);
assertEquals("edit approval item", taskSummary.getName());
abortTask(taskService, "userC");
assertNodeTriggered(processInstanceId, "aborted");
System.out.println("Process instance completed");
log.close();
manager.disposeRuntimeEngine(engine);
manager.close();
}
示例6: main
import org.kie.api.runtime.manager.RuntimeManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
RuntimeManager manager = Util.getRuntimeManager();
RuntimeEngine engine = manager.getRuntimeEngine(EmptyContext.get());
KieSession kSession = engine.getKieSession();
for (int i = 0; i < 50000; i++) {
System.out.println("Starting process number " + i);
kSession.startProcess("org.fxapps.bpms.helloProcess");
}
manager.disposeRuntimeEngine(engine);
manager.close();
}
示例7: main
import org.kie.api.runtime.manager.RuntimeManager; //导入方法依赖的package包/类
public static void main(String[] args) throws InterruptedException {
// no delay to call the executor and not using JMS
System.setProperty("org.kie.executor.jms", "false");
System.setProperty("org.kie.executor.initial.delay", "1");
JBPMHelper.startH2Server();
JBPMHelper.setupDataSource();
// This entity manager factory contains Executor entities
EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.persistence.with.executor");
ExecutorService executorService = ExecutorServiceFactory.newExecutorService();
// initialize the executor service - it is important or it won't work
executorService.init();
RuntimeEnvironment env = RuntimeEnvironmentBuilder.Factory
.get()
.newEmptyBuilder()
// remember to register the executor service
.addEnvironmentEntry("ExecutorService", executorService)
.entityManagerFactory(emf)
.addAsset(
KieServices.Factory.get().getResources()
.newClassPathResource("org.jbpm.async_test.v1.0.bpmn2"),
ResourceType.BPMN2).get();
RuntimeManager runtimeManager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(env);
RuntimeEngine engine = runtimeManager.getRuntimeEngine(EmptyContext.get());
KieSession kieSession = engine.getKieSession();
// registering the WIH for the Service task
kieSession.getWorkItemManager().registerWorkItemHandler("Service Task", new ServiceTaskHandler());
kieSession.startProcess("test.async_test");
runtimeManager.disposeRuntimeEngine(engine);
}
示例8: main
import org.kie.api.runtime.manager.RuntimeManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
RuntimeManager manager = Util.getRuntimeManager();
RuntimeEngine engine = manager.getRuntimeEngine(EmptyContext.get());
KieSession kSession = engine.getKieSession();
TaskService taskService = engine.getTaskService();
Long piid = kSession.startProcess("org.fxapps.bpms.HT").getId();
Long tid = taskService.getTasksByProcessInstanceId(piid).iterator().next();
taskService.start(tid, "bpmsAdmin");
taskService.complete(tid, "bpmsAdmin", null);
manager.disposeRuntimeEngine(engine);
manager.close();
}
示例9: main
import org.kie.api.runtime.manager.RuntimeManager; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
RuntimeManager manager = Util.getRuntimeManager();
RuntimeEngine engine = manager.getRuntimeEngine(EmptyContext.get());
KieSession kSession = engine.getKieSession();
for (int i = 0; i < 100; i++) {
System.out.println("Starting process number " + i);
kSession.startProcess("org.fxapps.bpms.helloProcess");
}
manager.disposeRuntimeEngine(engine);
manager.close();
}