Description of problem: Platform BZ for https://issues.jboss.org/browse/JBPM-3792 Steps to Reproduce: See details in JBPM-3792 Actual results: WorkItemHandler gets null from StatefulKnowledgeSessionUtil.getStatefulKnowledgeSession() Expected results: WorkItemHandler gets ksession from StatefulKnowledgeSessionUtil.getStatefulKnowledgeSession()
Maciej Swiderski <swiderski.maciej> made a comment on jira JBPM-3792 This happens because work item handler is registered before session is returned to the StatefulKnowledgeSessionUtil class. Since it uses CustomWorkItemHandlers.conf that is read and processed as part of session initialization. To overcome this (among others) issue configurable session support was introduced for console: JBPM-3724 So workaround is the way to go here or back port configurable session support to allow handlers to get session injected on creation. Wdyt?
Toshiya Kobayashi <tkobayas> made a comment on jira JBPM-3792 Thanks Maciej, fixing this by JBPM-3724 sounds great. Regarding backport to BRMS 5.3 branch, this issue itself is not serious as it has a workaround (So backport is not strongly required). But JBPM-3724 seems to introduce flexibility which will solve future issues. If you think backport is not risky, it would be greatly appreciated.
In general, I don't think it is risky to backport it. Only concer is that it would introduce additional testing effort for it and as far as I know there is not much time left especially considering it has a workaround
Hi Lukas, do you have any comment regarding testing effort?
Maciej Swiderski <swiderski.maciej> made a comment on jira JBPM-3792 As soon as we merge provided pull request it will be possible to inject ksession directly into custom work item handler using: new CustomWorkItemHandler(ksession) inside configuration file. That is much less risky way of solving this problem compared to backporting JBPM-3724.
Maciej Swiderski <swiderski.maciej> updated the status of jira JBPM-3792 to Resolved
Maciej Swiderski <swiderski.maciej> made a comment on jira JBPM-3792 change was applied so conf files can refer to ksession as part of work item initialization, for example: [ "Log": new com.sample.MyWorkItemHandler(ksession), "Email": new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler(), ] obviously there must be corresponding constructor