This content has been marked as final.
Show 2 replies
-
1. Re: Trying to complete a workitem from a separate global listener, jBpm 6.2
nichuk Aug 10, 2015 5:57 PM (in response to nichuk)For completeness, the code I'm currently using, which doesn't work is:
long workItemId = (long)commandMap.get("_workItemId"); CompleteWorkItemCommand completeCommand = new CompleteWorkItemCommand(workItemId, commandMap); KieServices kieServices = KieServices.Factory.get(); KieContainer kContainer = kieServices.getKieClasspathContainer(); KieSession kSession = kContainer.newKieSession(); WorkItemManager workItemManager = kSession.getWorkItemManager(); workItemManager.completeWorkItem(workItemId, commandMap); logger.info("Execute Complete"); kSession.dispose(); This executes with no errors, but the process instance is not moved on, and stays halted where it was.
-
2. Re: Trying to complete a workitem from a separate global listener, jBpm 6.2
nichuk Aug 10, 2015 7:58 PM (in response to nichuk)Having tried a variety of methods... The only one that seems to work is:
RuntimeManager manager = RuntimeManagerRegistry.get().getManager(deploymentId);
RuntimeEngine engine = manager.getRuntimeEngine(EmptyContext.get());
KieSession kSession = engine.getKieSession();
WorkItemManager workItemManager = kSession.getWorkItemManager(); workItemManager.completeWorkItem(workItemId, commandMap); Is this legit? Or is there a better way? Using 6.2.0.Final.
Thanks!