This content has been marked as final.
Show 3 replies
-
1. Re: Optional actor-id
kukeltje May 14, 2008 3:44 PM (in response to tom_goring)write your own assignmenthandler
-
2. Re: Optional actor-id
tom_goring May 14, 2008 4:35 PM (in response to tom_goring)Thanks for that...
I've looked though the examples... can you give me a pointer to as to how best to pass arguments to the handler? Or do I need to use the process variables?
I was hoping I could do the below but as soon as I change:<assignment class="jnet.faces.PersonAssignmentHandler"></assignment>
To<assignment class="jnet.faces.PersonAssignmentHandler" pooled-actors="#{accountantCompany.entityId}" actor-id="#{personRelations.getPersonManagerActorId(accountantCompany)}"></assignment>
My handler is nolonger called:public class PersonAssignmentHandler implements AssignmentHandler { public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception { String groupId = Interpolator.instance().interpolate(executionContext.getTask().getPooledActorsExpression()); String actorId = Interpolator.instance().interpolate(executionContext.getTask().getActorIdExpression()); if ( !StringUtil.isNullOrBlank(actorId) ) { assignable.setActorId(actorId); } if ( !StringUtil.isNullOrBlank(groupId) ) { assignable.setPooledActors(new String[] {groupId}); } }
-
3. Re: Optional actor-id
kukeltje May 14, 2008 4:52 PM (in response to tom_goring)correct, you have to pass parameters like you do with normal actionhandlers, so something like
<assignment class="jnet.faces.PersonAssignmentHandler"> <pooled-actors>#{accountantCompany.entityId}</pooled-actors> <actor-id>#{personRelations.getPersonManagerActorId(accountantCompany)}</actor-id> </assignment>
Then have the properties/setters/getters called pooled-actors and actor-id as strings, and then in the assign method, parse these strings as EL (see jbpm source for some examples) and you're there.
Nice btw that you experimented yourself. Often people just reply 'how do I do that', which makes me less interested in replying. This however does the opposite. Neat...