[rules-users] Resuming a simple process involving human task

Touma database666 at gmail.com
Wed Apr 14 11:02:22 EDT 2010


Hi Tolitius,

As per your and Vijay's suggestion, I did try out a couple of things, mainly
reloading the session, re-registering the work handlers and invoke the
completeWorkItem() method on the work item manager but still no luck. The
thing which has got me stumped here is that after invoking the
completeWorkItem() method, the relevant entry in the database for that
WorkItem is deleted but the flow still doesn't resume!

@Everyone

I've been following a synchronous approach here (no Mina library) so I'd
much appreciate if someone can point me in the right direction as to how
much code needs to be pulled out from the WsHumanTaskWorkItemHandler to make
this work.

On a related note, after digging really deep into the code I see that when
invoking the TaskCompletedCommand, a "workItemCompleted" event is sent to
the process but it isn't received by anything and hence my flow doesn't
resume. Do I need to do anything special to register these handlers? Also,
invoking the method getEventTypes() on the Process instance returns an empty
array; is this normal?

*Any* kind of pointer or help here would be much appreciated. :)

TIA.

Peace,
/T\



tolitius wrote:
> 
> @Touma,
> 
>     There are a couple of ways to resume the flow:
> 
>          1. Complete a work item that causes the process to wait.
> 
>          2. Post (signal) the event, which is a different thread, hence
> can restart / resume the flow at any point.
> 
>     In your case, as Vijay pointed out, you would have to complete a work
> item. However you don't have to rely on MinaServer / Client to do that.
> The out of the box WS-HT Drools Flow implementation is tightly coupled
> with MinaServer (it is not pluggable with any other solutions), hence you
> would have to create your own WorkitemHandler to do that.
> 
>     If you already have all the IDs ( session, work item, etc.. ), it
> should be as simple as:
> 
>                 // re-load the session
> 		ksession = JPAKnowledgeService.loadStatefulKnowledgeSession(
> YOUR_SESSION_ID, knowledgeBase, null, env );
> 		
>                 // DON'T FORGET TO RE-REGISTER ALL THE WORK ITEM HANDLERS
> HERE...
> 		
>                 // complete the work item
> 		ksession.getWorkItemManager().completeWorkItem( YOUR_WORK_ITEM_ID, null
> );
> 
> Good Luck,
> /Anatoly
> 

-- 
View this message in context: http://n3.nabble.com/Resuming-a-simple-process-involving-human-task-tp716250p718721.html
Sent from the Drools - User mailing list archive at Nabble.com.



More information about the rules-users mailing list