1 Reply Latest reply on Jan 31, 2013 12:47 PM by Maciej Swiderski

    When do Sub Task Strategy executed?

    Thomas Setiabudi Expert

      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