Bug 858607 - WorkItemHandler gets null from StatefulKnowledgeSessionUtil.getStatefulKnowledgeSession() in its constructor
WorkItemHandler gets null from StatefulKnowledgeSessionUtil.getStatefulKnowle...
Status: ASSIGNED
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: jBPM Console (Show other bugs)
BRMS 5.3.0.GA
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Maciej Swiderski
Radovan Synek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-19 04:27 EDT by Toshiya Kobayashi
Modified: 2015-07-08 13:31 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 958402 (view as bug list)
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker JBPM-3792 Minor Resolved WorkItemHandler gets null from StatefulKnowledgeSessionUtil.getStatefulKnowledgeSession() in its constructor 2013-11-23 19:30:41 EST

  None (edit)
Description Toshiya Kobayashi 2012-09-19 04:27:06 EDT
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()
Comment 3 JBoss JIRA Server 2012-09-26 02:51:47 EDT
Maciej Swiderski <swiderski.maciej@gmail.com> 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?
Comment 4 JBoss JIRA Server 2012-09-26 03:30:34 EDT
Toshiya Kobayashi <tkobayas@redhat.com> 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.
Comment 5 Maciej Swiderski 2012-09-27 05:12:05 EDT
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
Comment 6 Toshiya Kobayashi 2012-09-27 05:23:59 EDT
Hi Lukas, do you have any comment regarding testing effort?
Comment 9 JBoss JIRA Server 2012-10-02 05:16:39 EDT
Maciej Swiderski <swiderski.maciej@gmail.com> 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.
Comment 10 JBoss JIRA Server 2012-10-22 06:03:03 EDT
Maciej Swiderski <swiderski.maciej@gmail.com> updated the status of jira JBPM-3792 to Resolved
Comment 11 JBoss JIRA Server 2012-10-22 06:03:03 EDT
Maciej Swiderski <swiderski.maciej@gmail.com> 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

Note You need to log in before you can comment on or make changes to this bug.