-
1. Re: assign swimlane dynamically according to previous transi
kukeltje Aug 15, 2007 4:27 AM (in response to rossputin)swimlanes are not dynamic. Once set, it is set, unless you change the actors via the api. So you can e.g. create an actionhandler on the transition that sets the swimlane e.g. based on a processvariable.
-
2. Re: assign swimlane dynamically according to previous transi
kukeltje Aug 15, 2007 4:31 AM (in response to rossputin)there is a jira issue for the making swimlanes more dynamic. Please vote for it
-
3. Re: assign swimlane dynamically according to previous transi
rossputin Aug 15, 2007 4:34 AM (in response to rossputin)Hi thanks,
this definitely sounds like what I need to do, is it supported within the graphical designer yet, or do I need to do it in process definition xml?
Is it possible you could point me to a very simple example of this?
Thanks for your help,
Ross -
4. Re: assign swimlane dynamically according to previous transi
kukeltje Aug 15, 2007 6:44 AM (in response to rossputin)????
-
5. Re: assign swimlane dynamically according to previous transi
syngolis Aug 15, 2007 7:12 AM (in response to rossputin)http://www.jboss.com/index.html?module=bb&op=viewtopic&t=113008
"koen.aers@jboss.com" wrote:
As for skipping the start-state. You can start the process in any node from jPDL 3.2 on. Just do not model a start-state and add initial="true" as an attribute on the node (state, mail-node, process-state, etc) that you want to be the first node in the process-definition.
Regards,
Koen
...seems that i was not right at all... -
6. Re: assign swimlane dynamically according to previous transi
syngolis Aug 15, 2007 7:33 AM (in response to rossputin)OK...memo to myself: first test then write...
This unit test shows the use of initial. It also shows, that my first attempt was right.ProcessDefinition processDefinition = ProcessDefinition.parseXmlString( "<process-definition" + " xmlns='' name='test' initial='task1'>" + " <task-node name='task1'>" + " <task name='task1'>" + " </task>" + " <transition name='' to='end1'></transition>" + " </task-node>" + " <end-state name='end1'></end-state>" + "</process-definition>" ); ProcessInstance processInstance = new ProcessInstance(processDefinition); Token token = processInstance.getRootToken(); assertSame(processDefinition.getNode("task1"), token.getNode());
-
7. Re: assign swimlane dynamically according to previous transi
rossputin Aug 15, 2007 7:49 AM (in response to rossputin)Hi guys,
I am sorry, I don't think I am making the question clear,
I am hoping to design in the eclipse designer a process where according to a variable set early on... a task later in the process is assigned accordingly to user A or user B.
Ronald your idea of setting the actor for a swimlane via the api.. can I include a custom actionhandler on a transition in the eclipse designer.. as I hope to be building the process definitions within the eclipse designer?
Syngolis, did you mean to reply in this post, I don't understand what you are saying,
thanks for your help
regards
Ross -
8. Re: assign swimlane dynamically according to previous transi
syngolis Aug 15, 2007 7:57 AM (in response to rossputin)sorry, wrong topic...
-
9. Re: assign swimlane dynamically according to previous transi
vtysh Aug 15, 2007 8:03 AM (in response to rossputin)rossputin Just write custom assignmentHandler, example you can find in jbpm sources.
-
10. Re: assign swimlane dynamically according to previous transi
rossputin Aug 15, 2007 8:33 AM (in response to rossputin)Cheers for your help guys, sorry for my newbieness, I think I am beginning to see the picture...
if I create a custom AssignmentHandler, I can attach this in the eclipse designer to the transition element where I want the process to be assigned according the variable I set earlier...?
I found an example of a custom handler at org.jbpm.tutorial.taskmgmt, 'the nappy concept' being appropriate here,
and my particular task where I need dynamic assignment should look something like..<task-node name='test task node'> <task name='test task'> <assignment class='org.some.project.assignmenthandlers.TestAssignmentHandler' /> </task> <transition to='end' /> </task-node>
thanks for your help and patience,
regards,
Ross -
11. Re: assign swimlane dynamically according to previous transi
kukeltje Aug 15, 2007 9:46 AM (in response to rossputin)but then you have to add this to EACH task.... that is what swimlanes are for if they were just a little more dynamic. The last proposal to me is a workaround.
An assignmenthandler cannot be attached to a transition. You have to write an actionhandler that does an assignment. -
12. Re: assign swimlane dynamically according to previous transi
rossputin Aug 15, 2007 9:56 AM (in response to rossputin)Hi,
I see your point, yes dynamic swimlanes would be a better approach,
how do I vote on the JIRA issue related to this topic ?
cheers
Ross -
13. Re: assign swimlane dynamically according to previous transi
rossputin Aug 15, 2007 11:15 AM (in response to rossputin)Hi,
I am getting the following error when testing a simple process with a custom assignment handler attached to a task...
Error completing task: An exception of type "org.jbpm.graph.def.DelegationException" was thrown.
I compiled my handler, and put it under WEB-INF/classes in my web app. The node in question is...<task-node name="decision chose red light"> <task name="decision made red"> <assignment class="DatacentreAssignmentHandler"></assignment> </task> <transition to="end decision"></transition> </task-node>
and the body of my 'assign' method is...ContextInstance contextInstance = executionContext.getContextInstance(); if (contextInstance.getVariable("colour").equals("green")) { assignable.setActorId("ross"); } else { assignable.setActorId("user"); }
what might be causing this?
Thanks for your help in advance,
regards
Ross -
14. Re: assign swimlane dynamically according to previous transi
vtysh Aug 16, 2007 1:41 AM (in response to rossputin)Give us a stacktrace