[jboss-user] [JBoss jBPM] - Re: JBPM Identity
do-not-reply at jboss.com
Mon Jun 1 14:47:39 EDT 2009
I may missing one last thing. It may sound dull, but I've been asking myself and couldn't find any cleaner solution than the one I'm finally using.
So here it is :
When I was using the default ExpressionAssignmentHandler, I used to pass it an Expression. (Well nothing stunning until now). This expression was some kind of clue to which actor was finally getting the task.
Now, I'm using my own AssignmentHandler, but it seems like the only possibility to pass it a clue to which user (or group) is actually getting the task is by using variables. So I end up writing something like this :
In the class that creates a new process instance :
| HashMap<String,Object> variables = new HashMap<String,Object>();
| variables.put(contractID, "" + contractID);
| variables.put("group", "control-attendants");
In the AssignmentHandler :
| String group = (String)executioncontext.getVariable("group");
It's working, but I hate it. It ties the process definition to my code : the group name is completly resolved in the code.
Is there any other way in the process definition to define a variable that I would get as a clue in my AssignmentHandler ?
Or even a cleaner solution that you would think of ?
Thanks for your time and opinion.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4234555#4234555
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4234555
More information about the jboss-user