-
1. Re: Cange swimlane at runtime
kukeltje Dec 2, 2008 9:08 AM (in response to pgros)so your subject is wrong... I almost pointed you to page 2 of this forum where the answer is 'use the api' It is normally best to start with your *real problem* in the beginning of the post. If it is in the end and more than 50% of this post is like a previous one (it's 95% for this post) I stop reading... you are lucky now....
Still... the answer is 'use the api' At any moment in time you can change it, just *not* before it reaches the tasknode. Using an assignmenthandler is then probably best. You can do anything in there. -
2. Re: Cange swimlane at runtime
pgros Dec 2, 2008 10:00 AM (in response to pgros)When i create my process instance i set the var "SWIMLANE" to "Unknown"
i have following nodes
startstate -> node -> tasknode1 -> tasknode2
"node" sets var "swimlane" to "test"
then i overrided the enter() function of tasknode as following@Override public void enter(ExecutionContext executionContext) { // TODO Auto-generated method stub super.enter(executionContext); for ( TaskInstance ti : (Collection<TaskInstance>)getTaskMgmtInstance(executionContext.getToken()).getTaskInstances()) { ti.setActorId(executionContext.getVariable("SWIMLANE").toString()); System.out.println("Set " + ti.getName() + " actor to " + executionContext.getVariable("SWIMLANE").toString()); } }
Output:
Set node1task actor to Unknown
Set node2task actor to Test
but node1task should have been set to test, too...
seems that the variable isn't set fast enough or something like that, how can it be? ... i didn't set any asynchonous nodes -
3. Re: Cange swimlane at runtime
kukeltje Dec 2, 2008 10:49 AM (in response to pgros)This is way to complex... as mentioned use an assignmenthandler....