-
1. Re: running decision node(jbpm 4.0) multiple times for single processInstance
swiderski.maciej Mar 2, 2010 2:35 AM (in response to praneet)Hi,
Perhaps you do not need to go through decision node many times, instead you could send mail to many recipients at once unless each mail is personalized for particular student?!
If your use case requires personalized email to be sent you could achieve it by using additional decision point after mail node to check if there are more emails in the queue. You can use event listener on mail node (on end) to inspect if there are any more emails to be sent. If there are waiting messages to be sent you navigate back to mail node if not go on to end state.
HTH
Maciej
-
2. Re: running decision node(jbpm 4.0) multiple times for single processInstance
praneet Mar 2, 2010 11:03 PM (in response to swiderski.maciej)thanks Maciej for quick rply,
suppose in my usecase 5 students are selected and 2 not then how can i handle these situation while moving from task node to decision node,what to write in decision node to handle these 5 students(talking abt personal email for each student).
-
3. Re: running decision node(jbpm 4.0) multiple times for single processInstance
swiderski.maciej Mar 3, 2010 2:58 AM (in response to praneet)you could write your DecisionHandler class that would do all required work for you, for instance get process variables that defined what students should receive e-mail. Depending on what your task will do while processing the form.
Keep in mind that you can also you EventListner (for a task node) to adjust some process variables if needed.
Cheers,
Maciej
-
4. Re: running decision node(jbpm 4.0) multiple times for single processInstance
praneet Mar 3, 2010 4:01 AM (in response to swiderski.maciej)thanks for replying
ya i have done in my decision handler as u have said
my decide method is like this
public String decide(OpenExecution execution) {
// in email i got email address of all student
List<String> email=(List<String>) execution.getVariable("email");
// in actions i got action of all student suppose for 7 it is 'Select'
and for 3 it is 'Reject'
List<String>actions=(List<String>) execution.getVariable("action");
// count contains the no of students
int count=(Integer)execution.getVariable("count");
// what to write here so that for each student corresponding
transitions will be matched for particular student,means how to extract values from action
list for each student so that corresponding transition takes place
}
this is my handler node
<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>
-
5. Re: running decision node(jbpm 4.0) multiple times for single processInstance
swiderski.maciej Mar 3, 2010 4:23 AM (in response to praneet)I would try something like that:
1. set count variable to 0 if it does not exist or increment by one if exists
2. extract information (email address, name, etc) for a student from list of selected students - for one student - use count to get correct student info
3. check is user is selected or rejected, id selected proceed with following steps if rejected repeat step 1 and 2
3. set variable that consists of this information - this information will be used by mail node to populate email message
4. forward flow to mail node
5. mail node sends the message end gets back to decision node for another verification
6. if there are more students to be notified repeat above steps
Have not tested that but I would give it a try...I think it is a one way to go to achieve your goal.
Cheers,
Maciej