-
1. Re:
jbarrez Mar 5, 2009 8:09 AM (in response to alclientview)Creating runtime tasks is easy: simple create a new TaskInstance and save it with Hibernate. The only caveat is that it needs a token, I believe (which is a bad design choice, but it works nonetheless).
In jBPM4, the task component will be a seperate component, which will allow even easier creation of runtime tasks. -
2. Re:
alclientview Mar 5, 2009 9:17 PM (in response to alclientview)I agree it's easy to create task instances at runtime and that's the way I'm using when the implementation requires such feature. But it's a bit different... I was talking about Task (not task instance). Also the default implementation of the Task instance is that its properties are copied from the Task definition when it is created... I know we don't have to follow the default implementation, JBPM is flexible enough for that. But my point is more about the logic of domain model.
Let's take an example, I have an "Approval task node" that handles the approval from two departments: HR and Accounting. When I design this by using the GPD, I will create two Tasks and at runtime one Task instance will be created for each Task.
Now if I want to do this at runtime by using a rule file (or a delegation class), one way would be to create a default Task definition for this node when designing my process and then at runtime my rules will create two Task instances (one for HR and one for Accounting) for the same Task definition.
For the same idea, which is 2 Tasks one for HR and one for Accounting (at least in the BA point of view) I'm not using the same objects of my domain model to implement it. I'm just wondering if this is ok.... ? Yes, the implementation works fine in both cases but what if one day I'm stuck because I found out I can do some specific reporting in one case but not in the other case since the implementation is different ? -
3. Re:
kukeltje Mar 5, 2009 9:30 PM (in response to alclientview)Let's take an example, I have an "Approval task node" that handles the approval from two departments: HR and Accounting. When I design this by using the GPD, I will create two Tasks and at runtime one Task instance will be created for each Task.
That is indeed an optionNow if I want to do this at runtime by using a rule file (or a delegation class), one way would be to create a default Task definition for this node when designing my process and then at runtime my rules will create two Task instances (one for HR and one for Accounting) for the same Task definition.
Correct, again, an option
For the same idea, which is 2 Tasks one for HR and one for Accounting (at least in the BA point of view) I'm not using the same objects of my domain model to implement it. I'm just wondering if this is ok.... ? Yes, the implementation works fine in both cases but what if one day I'm stuck because I found out I can do some specific reporting in one case but not in the other case since the implementation is different ?
Then you have the same api at you disposal and you can 'migrate' the tasks or the complete processes by deploying a new processdefinition (or changing the existing one as you found out is also possible) and place the part of the tokens in the new tasknodes. Since you obviously want to minimize that and have clear e.g. swimlanes, make sure in advance (design time) things are split.