Activiti源码学习:ExecutionListener与TaskListener的区别

/** Callback interface to be notified of execution events like starting a process instance,
 * ending an activity instance or taking a transition.
 *  
 * @author Tom Baeyens
 * @author Joram Barrez
 */
public interface ExecutionListener extends Serializable {

  String EVENTNAME_START = "start";
  String EVENTNAME_END = "end";
  String EVENTNAME_TAKE = "take";

  void notify(DelegateExecution execution) throws Exception;
}
/**
 * @author Tom Baeyens
 */
public interface TaskListener extends Serializable {

  String EVENTNAME_CREATE = "create";
  String EVENTNAME_ASSIGNMENT = "assignment";
  String EVENTNAME_COMPLETE = "complete";
  String EVENTNAME_DELETE = "delete";
  
  
  /**
   * Not an actual event, used as a marker-value for {@link TaskListener}s that should be called for all events,
   * including {@link #EVENTNAME_CREATE}, {@link #EVENTNAME_ASSIGNMENT} and {@link #EVENTNAME_COMPLETE} and {@link #EVENTNAME_DELETE}.
   */
  String EVENTNAME_ALL_EVENTS = "all";
  
  void notify(DelegateTask delegateTask);
}

针对的事件不同:start,end, take 与 create,assignment, complete, delete.

通知的代理不同:DelegateExecution 与 DelegateTask

posted @ 2017-12-04 10:44  任国强  阅读(10907)  评论(0编辑  收藏  举报