Bug 858607 - WorkItemHandler gets null from StatefulKnowledgeSessionUtil.getStatefulKnowledgeSession() in its constructor
Summary: WorkItemHandler gets null from StatefulKnowledgeSessionUtil.getStatefulKnowle...
Keywords:
Status: ASSIGNED
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: jBPM Console
Version: BRMS 5.3.0.GA
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Kris Verlaenen
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-19 08:27 UTC by Toshiya Kobayashi
Modified: 2023-05-31 22:25 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 958402 (view as bug list)
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker JBPM-3792 0 Minor Resolved WorkItemHandler gets null from StatefulKnowledgeSessionUtil.getStatefulKnowledgeSession() in its constructor 2013-11-24 00:30:41 UTC

Description Toshiya Kobayashi 2012-09-19 08:27:06 UTC
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 06:51:47 UTC
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?

Comment 4 JBoss JIRA Server 2012-09-26 07:30:34 UTC
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.

Comment 5 Maciej Swiderski 2012-09-27 09:12:05 UTC
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 09:23:59 UTC
Hi Lukas, do you have any comment regarding testing effort?

Comment 9 JBoss JIRA Server 2012-10-02 09:16:39 UTC
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.

Comment 10 JBoss JIRA Server 2012-10-22 10:03:03 UTC
Maciej Swiderski <swiderski.maciej> updated the status of jira JBPM-3792 to Resolved

Comment 11 JBoss JIRA Server 2012-10-22 10:03:03 UTC
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


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