-
1. Re: getting name of leaving transition from decision node (jbpm 4.0)
swiderski.maciej Mar 3, 2010 4:26 AM (in response to praneet)on ftl forms you can use something like this to create buttons for each available transition:
<#list outcome.values as transition> <input type="submit" name="outcome" value="${transition}"> </#list>
/Maciej
-
2. Re: getting name of leaving transition from decision node (jbpm 4.0)
praneet Mar 3, 2010 4:43 AM (in response to swiderski.maciej)thanks for replying swider
what am using is combobox which will contain value which is select or reject,
for each student there is combobox which i will select and finally i have submit button.
and am using my own jsp page.
if i will select 'select' then it will refer to select transition and then it move on corresponding node
-
3. Re: getting name of leaving transition from decision node (jbpm 4.0)
swiderski.maciej Mar 3, 2010 4:48 AM (in response to praneet)so it means that you have only one transition that follows the submit button and combo boxes are just variables that will be submitted as variables - isn't that true?
Unless you have a separate form for each student... -
4. Re: getting name of leaving transition from decision node (jbpm 4.0)
praneet Mar 3, 2010 5:02 AM (in response to swiderski.maciej)ya form submission is in task node and there after is decision node
what i want is value in combobox should cm from the transitions taking from decision node
<task assignee="#{hrname}" g="104,114,155,52" name="Select-Student">
<transition g="-42,-18" name="to Selected?" to="Selected?"/>
</task>
<decision name="Selected?" g="96,102,48,48" >
<handler class="jbpm.MyHandler" />
<transition name="Select" to="send-interview-email" g="120,60:-36,23" />
<transition name="Reject" to="end1" g=":-15,-21" />
</decision>
so i want Select and Reject in combobox.meaning is that suppose after some day i also wantone transition like pending, so i can dynamically include this inmy combobox -
5. Re: getting name of leaving transition from decision node (jbpm 4.0)
swiderski.maciej Mar 3, 2010 6:25 AM (in response to praneet)ok, so what you are trying to do is to create a combo box based on values from a node's transitions and make them available on task form.
One value from the list can be selected and default transition from task node is taken to move to decision point. Decision point takes the correct transition based on process variable set with value of the combo box selected on task form.
The reason why you want to do that is that you have an external JSP page that acts as task form.
Did I follow your case correctly?
If so, to me it seems like mixing to nodes into one. As far as I understand it is that you do not want to change your JSP page when changing process?!
Perhaps you could use process variable that keeps information about possible values for combo box that can be easily mapped to decision point transitions - does it make sense to you?
-
6. Re: getting name of leaving transition from decision node (jbpm 4.0)
praneet Mar 3, 2010 6:44 AM (in response to swiderski.maciej)Did I follow your case correctly?
ya u are
does it make sense to you?
no ,i dont want to use process variable
i want some api or workaround such that
node.getallleavingtransitionsname
and then i want to store it in process variable so that
i can extract these values in combobox while displaying my jsp page.
-
7. Re: getting name of leaving transition from decision node (jbpm 4.0)
swiderski.maciej Mar 3, 2010 8:09 AM (in response to praneet)where do you want to place this method call (node.getAllLeavingTransitionName)? Afaik there is no such method available in public API. Most likely you could achieve that using internal classes but that is not recommended.
And since at the end you will put the values (transition names) as process variables why not doing that directly?! From JSP page point of view it's transparent either you will use dynamic query of node's transitions or set it manually as process variable in the model.
-
8. Re: getting name of leaving transition from decision node (jbpm 4.0)
praneet Mar 3, 2010 11:13 PM (in response to swiderski.maciej)there is no such method available in public API
i know this there is no such method like this ,but i am expecting if there such
From JSP page point of view it's transparent either you will use dynamic query of node's transitions or set it manually as process variable in the model.
suppose if tomorrow i have to include two more transition then i need to set these two also using processvariable which is not good as i have to modify this code.so i want solution like this so that if new transition come there is no need to change the code.
-
9. Re: getting name of leaving transition from decision node (jbpm 4.0)
swiderski.maciej Mar 4, 2010 4:50 AM (in response to praneet)I completely understand your goals but I think it can be achieved differently than querying for outgoing transition of a given node. Since you have to modify the diagram I would try something like this:
Add event listener to the start node on event end that will set required variables:
<on event="end"> <event-listener class="com.company.process.StartupEventListener"> <field name="taskOptionsAsVariable"><string value="selected,rejected"/></field> </event-listener> </on>
Create class for that event listener:
public class StartupEventListener implements EventListener { private String taskOptionsAsVariable; @Override public void notify(EventListenerExecution execution) throws Exception { if (taskOptionsAsVariable != null) { String[] options = taskOptionsAsVariable.split(","); execution.createVariable("selectionOptions", Arrays.asList(options)); } } }
Since there is no support (afaik) for collections and arrays use comma separated values for possible options to choose in the task form later in the process - same as outgoing transitions for decision point.
So after first release you don't need to change anything in the code, just the diagram.
Hope that can give you an alternative.
Cheers,
Maciej
-
11. Re: getting name of leaving transition from decision node (jbpm 4.0)
kukeltje Mar 7, 2010 7:38 PM (in response to swiderski.maciej)In addition to this, decisions are NOT STATES. So it really feels like a putting a conceptually wrong solution in a kind of hacky way in jBPM. Using variables from a task is what needs to be used or even just a task with transitions (that you can query) and call that task 'decide' -
12. Re: getting name of leaving transition from decision node (jbpm 4.0)
praneet Mar 7, 2010 11:31 PM (in response to kukeltje)hi ronald
thanks for replying
but am unable to get what u are saying ,can u put some more light on this .
what am getting is u waana say is instead of using decision we should use
task node.
-
13. Re: getting name of leaving transition from decision node (jbpm 4.0)
swiderski.maciej Mar 8, 2010 2:21 AM (in response to kukeltje)Ronald, what do you mean by decisions are NOT STATES - did I suggested something like that?
My intention was to suggest a way to setup variables that can be used as input to task node instead of querying for outgoing transitions of a node that is after task node.
Apologies if I made myself unclear or put irrelevant content.
/Maciej
-
14. Re: getting name of leaving transition from decision node (jbpm 4.0)
kukeltje Mar 8, 2010 3:45 AM (in response to swiderski.maciej)No, you did not suggest this. It was my impression that the original poster wants to use it like this.