Basically you have two options here : client decision or server decision.
The first option is the so called hard-code option you mention. You have two buttons on the form and depending on which button gets clicked the webapp signals the process to continue along the corresponding transition. The websale process uses this mechanism (though it is not really hardcoded as the forms are generated by the default webform mechanism).
The second mechanism is more fit for condition externalization. In this case you would have one transition from the task node to a decision node. Still, the client would have to make a choice by pressing one out of two buttons. But in this case, the particular choice would be saved in a process variable and the decision would contain a boolean expression based on this process variable.
I hope this clarifies your concern a bit.
Thanks Kohen for your advices.
I've read carefully the chapter 7 Nodetype decision from jbpm documentation and I highlighted the concept of "decision handler".
Let me explain our context. We're an insurance company and we want to implement a "claim process". The company operates in a lot of branches (car, ship, person... and so). When the claim is registered in the ERP system automatically calculates if the associated client has his policy payed. If the system verifies any debt, assigns a task to a finance manager in order to him to authorize or not the claim. The complex here is that the finance managers are grouped by branch. So, the system has to assign a task to the correct manager having in mind the current branch. (there are more than 20 branches and it's still growing!!)
Mi concern is if the GPD has the ability to represent this visually so if new branches and assignments appear I simply add them with the visual tool. Otherwise I think about implementing that "DecisionHandler" and make a kind of "select... case" (or perhaps a DB table that maps branches and groups... or tasks, eventually) in order to assign correctly the task to the right person. What do you think?
What I need to be clear is how flexible is the tool to make this kinds of complexity easiest to mantain as possible. (point of view of our process analysts). From my developer role I would need to know about the strategy to follow to deal with this kind of complexities. Have you dealt with conditional and multiple assignments, for instance? Any further advice for it? I just want to go to the right developing criteria in order to start for the correct way.
Thank you again!!
From what I've seen in your problem, you would probably need to read on swimlanes and identity management. The identity management very flexible in that you could assign variable, group or user expressions to swimlanes.
In your case, you would probably create groups to represent your branches and add finance managers there as members. You also need to save the origin branch in a variable. You can use this variable in your swimlane so it would automatically know which branch or group the task is to be assigned. In this case you would'nt even need conditions. You would only need conditions if it needs to decide a business rule for example, if the amount > 100000 thus send approval to this branch.
What would reflect in you GPD would only be the swimlane, you dont need to mention branch.
Well, I have new concepts to keep researching to now. I really didn't have in mind the whole scope of swimlanes. Your suggestion was very clear. I wanted to focus that aspect of our problem because the most of our complexity is related to role assignment rather than the workflow itself. (talking about a few tasks and states).
I really apreciatte your clear comments about this topic. I have a more opened vision now about this technology and how it can help us.
PS: Next time, I promise to post smarter and complex questions.... "doubts from a semi-senior user" :-)