[rules-users] ProcessEventListener event order

jwest jmwest532 at gmail.com
Sun Jan 15 23:57:30 EST 2012


Hi Kris,

We are trying to write some info into a DB before and after a workItem gets
executed. To do this I need the workItem's definition name which we want to
use as a kind of workItem type (for example: Email). The problem we got is:
at beforeNodeTriggered (since workItem hasn't been triggered yet) we cannot
interrogate the workItem instance since is null.

*event.getNodeInstance().getNodeName()* doesn't help since it provides a
name the user gave to the workItem in a particular business process
definition (for example: MyManagerEmail).

At beforeNodeLeft, we succeeded with this code:

/if (event.getNodeInstance() instanceof WorkItemNodeInstance){
   WorkItemNodeInstance wi = (WorkItemNodeInstance)event.getNodeInstance();    		
   Workitemstatus dto = new Workitemstatus();
   dto.setWorkitemtype( wi.getWorkItem().getName());		//definition name
   dto.setWiName(event.getNodeInstance().getNodeName());	//given name inside
a bp
   ...
   save(dto);
}/

but we also need the workItem's definition name before the workItem
execution... We thought like Carlos we could use afterNodeTriggered, but we
found exactly the behavior you explained here, which brakes the sequence we
are looking for.

Is there another way to obtain the workItem's definition name inside the
beforeNodeTriggered method?

Cheers, Jim


--
View this message in context: http://drools.46999.n3.nabble.com/ProcessEventListener-event-order-tp1437084p3662233.html
Sent from the Drools: User forum mailing list archive at Nabble.com.



More information about the rules-users mailing list