JBoss Community

Re: How to get current node instance in a workitem handler?

created by J Xmith in jBPM - View the full discussion

Hi Affan,

 

I have got the same problem (your use cases are very valid). But I don’t understand your workaround. Currently the work item handler doesn’t have access to the knowledge session, so I am not sure what do you mean with “could just retrieve the process instance from the session and find…”  Could you please elaborate here?

 

I tried injecting the knowledge session at work item creation time (effectively achieving having the ksession inside the work item handler), but then when I was testing persistence and resuming after a crash I found the retrieved ksession was not identical to the original ksession that created/started the flow, and I found myself doing complex coding to try to solve problems. When my code became more complex than necessary, I realised everything would have been very simple if I could fetch the ksession from the  WorkItemManager. However the jbpm team has decided to hide the ksession from the work item, and very likely this mean we shouldn’t try to inject the ksession inside the work item ourselves.

 

I would be very interested to see what Kris is able to provide here.

 

Thanks in advance,

John.

Reply to this message by going to Community

Start a new discussion in jBPM at Community