Thomas Setiabudi
2013-01-30 10:59:10 UTC
Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion
"When do Sub Task Strategy executed?"
To view the discussion, visit: https://community.jboss.org/message/795110#795110
--------------------------------------------------------------
Hi,
We use JBPM 5.4.
We can set sub task strategy to a task, but we have some questions:
1. When do actually the code inside the execute(..) method of a Sub Task Strategy is called?
2. Where should we put the sub task strategy such as OnParentAbortAllSubTasksEndStrategy or OnAllSubTasksEndParentEndStrategy? on the parent task? on the sub task? both?
3. If we look at the implementation of org.jbpm.task.OnParentAbortAllSubTasksEndStrategy
public void execute(TaskServiceSession taskServiceSession, TaskService service, Task task) {
      Â
       List<TaskSummary> subTasks = taskServiceSession.getSubTasksByParent(task.getId(), "en-UK");
           for(TaskSummary taskSummary : subTasks){
               Task subTask = taskServiceSession.getTask(taskSummary.getId());
               service.addEventListener(new InternalTaskEventListener(taskServiceSession));
Â
Â
               service.getEventSupport().fireTaskCompleted( subTask.getId(),
                                                               subTask.getTaskData().getActualOwner().getId(),
                                                               subTask.getTaskData().getProcessSessionId());
           }
   }
Â
when do this code: service.getEventSupport().fireTaskCompleted( ..)
is executed?
Which part of it says that this will be executed when the parent task is aborted?
Any help is appreciated.
Regards,
Thomas Setiabudi
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/795110#795110]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
"When do Sub Task Strategy executed?"
To view the discussion, visit: https://community.jboss.org/message/795110#795110
--------------------------------------------------------------
Hi,
We use JBPM 5.4.
We can set sub task strategy to a task, but we have some questions:
1. When do actually the code inside the execute(..) method of a Sub Task Strategy is called?
2. Where should we put the sub task strategy such as OnParentAbortAllSubTasksEndStrategy or OnAllSubTasksEndParentEndStrategy? on the parent task? on the sub task? both?
3. If we look at the implementation of org.jbpm.task.OnParentAbortAllSubTasksEndStrategy
public void execute(TaskServiceSession taskServiceSession, TaskService service, Task task) {
      Â
       List<TaskSummary> subTasks = taskServiceSession.getSubTasksByParent(task.getId(), "en-UK");
           for(TaskSummary taskSummary : subTasks){
               Task subTask = taskServiceSession.getTask(taskSummary.getId());
               service.addEventListener(new InternalTaskEventListener(taskServiceSession));
Â
Â
               service.getEventSupport().fireTaskCompleted( subTask.getId(),
                                                               subTask.getTaskData().getActualOwner().getId(),
                                                               subTask.getTaskData().getProcessSessionId());
           }
   }
Â
when do this code: service.getEventSupport().fireTaskCompleted( ..)
is executed?
Which part of it says that this will be executed when the parent task is aborted?
Any help is appreciated.
Regards,
Thomas Setiabudi
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/795110#795110]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]