ExecutionListener was excuted 2 times, why?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2013 05:01 AM
I encouter a question.
I defined a class named ExecutionCommentListner implements ExecutionListener, and defined it's event="end"; like below:
public class ExecutionCommentListner implements ExecutionListener {
private static final long serialVersionUID = -6014971966749562667L;
public void notify(DelegateExecution exec) throws Exception {
// TODO Auto-generated method stub
System.out.println(exec.getVariable("approved"));
System.out.println(exec.getVariable("comment"));
System.out.println(exec.getCurrentActivityName());
}
}
when I complete the task node, I find ExecutionCommentListner was executed 2 times;
I got :
true
hello
null
true
hello
UserTask1
is this a bug , or did I do something wrong? BTW my version is 5.12
I defined a class named ExecutionCommentListner implements ExecutionListener, and defined it's event="end"; like below:
public class ExecutionCommentListner implements ExecutionListener {
private static final long serialVersionUID = -6014971966749562667L;
public void notify(DelegateExecution exec) throws Exception {
// TODO Auto-generated method stub
System.out.println(exec.getVariable("approved"));
System.out.println(exec.getVariable("comment"));
System.out.println(exec.getCurrentActivityName());
}
}
when I complete the task node, I find ExecutionCommentListner was executed 2 times;
I got :
true
hello
null
true
hello
UserTask1
is this a bug , or did I do something wrong? BTW my version is 5.12
Labels:
- Labels:
-
Archive
6 REPLIES 6
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-10-2013 08:33 AM
How does your BPMN XML look like?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2013 02:33 AM
<userTask id="directorAudit" name="ManagerAudit" activiti:assignee="${assignee}" activiti:formKey="audit.form">
<documentation>${applyUserName} want to apply ${days} days and ${type}(${startTime}to${endTime}) holiday</documentation>
<extensionElements>
<activiti:executionListener event="end" class="cn.com.etib.iacframework.activiti.service.ExecutionCommentListner"></activiti:executionListener>
</extensionElements>
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${security.getDirectorsByStarter(applier)}" activiti:elementVariable="assignee"></multiInstanceLoopCharacteristics>
</userTask>
<documentation>${applyUserName} want to apply ${days} days and ${type}(${startTime}to${endTime}) holiday</documentation>
<extensionElements>
<activiti:executionListener event="end" class="cn.com.etib.iacframework.activiti.service.ExecutionCommentListner"></activiti:executionListener>
</extensionElements>
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="${security.getDirectorsByStarter(applier)}" activiti:elementVariable="assignee"></multiInstanceLoopCharacteristics>
</userTask>
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-15-2013 02:35 AM
Above is a period of my bpm description, did I do anything wrong?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-16-2013 09:26 AM
It seems that you have more than one instance of the <code>directorAudit</code> activity - depending on the content of the <code>security.getDirectorsByStarter(applier)</code> you receive messages (log records) for each activity instance.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2013 03:03 AM
${security.getDirectorsByStarter(applier)} has only one result.
My situation is when I use ExecutionListner to listen to the task finish My listener was executed twoice, but when I change it to TaskListener, My listener was executed only once.
I have writer ExecutionCommentListner implements ExecutionListener and TaskCommentListner implements TaskListener to test the different situation.
My situation is when I use ExecutionListner to listen to the task finish My listener was executed twoice, but when I change it to TaskListener, My listener was executed only once.
I have writer ExecutionCommentListner implements ExecutionListener and TaskCommentListner implements TaskListener to test the different situation.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2013 04:49 AM
I'm guessing you're receiving one execution listener event for the task-instance being completed and another event when the whole multi-instance scope is completed… So in case you have a Munti-instance with 5 instances, you're execution-listener will be called 6 times. Can you validate this behavior?