JBoss Community

Re: A question about rule task in jBPM5

created by Maïté Braud in jBPM - View the full discussion

Hi Esteban,

 

Thanks for the quick feedback, I'm not sure how much my problem has to do with fireUntilHalt().

I was replying to the post of dalgwen and Tom G regarding the org.drools.persistence.info.WorkItemInfo not being properly persisted.

 

Curious fact : this error is triggerered in the second WorkItemHandler of my workflow, despite the fact that the first one use the same kind of code.

When I debug, i see that :

 

PersistenceContext context = ((PersistenceContextManager) env.get( EnvironmentName.PERSISTENCE_CONTEXT_MANAGER )).getCommandScopedPersistenceContext(); context.persist( workItemInfo );   ((WorkItemImpl) workItem).setId(workItemInfo.getId()); 

 

"workitemInfo" is ok, but its id is null, so the nullPointerException.

 

I also debugged with the first WorkItem of my workflow, and then the id is ok after the context.persist(...) call.

Don't know why it works the first time and not after.

 

Basically I've got a WorkItemHandler which wraps a call to an external webservice. Once finished, this webservice asynchronously sends me a webservice callback and I then call the WorkItemManager.completeWorkItem in order to queue the next step in the workflow.

 

I've persisted the WorkItemManager in a static variable in order to be able to access it from the client and the server but maybe that's the problem.

 

Thanks for the help.

Maïté

Reply to this message by going to Community

Start a new discussion in jBPM at Community