Activiti process link monitoring event

Project address: activiti-workflow

The process itself is to simplify some human operations. Activiti provides good support for the process, as well as the Activiti-explorer online design process.

Activiti-explorer can directly download the WAR package for deployment. After the deployment is completed, create a new test model, as shown in the figure for a process information
Insert picture description here

  • Process identifier: Process ID, start a process based on this ID

The picture below is the link information
Insert picture description here

  • ID: link ID
  • Task listeners: link monitoring events
    Insert picture description here

Click the + sign to add a new event
Insert picture description here
Event: create (new), assignment (distribution), complete (complete), delete (delete).
Some business processing can be done after the link is generated or approved.
Class: The full path of the class, which implements TaskListener .

@Service()
public class MyTaskListener implements TaskListener {


    @Override
    public void notify(DelegateTask delegateTask) {
        String eventName = delegateTask.getEventName();
        if ("create".endsWith(eventName)) {
            System.out.println("create=========");
        }else if ("assignment".endsWith(eventName)) {
            System.out.println("assignment========"+delegateTask.getAssignee());

        }else if ("complete".endsWith(eventName)) {
            System.out.println("complete===========");
        }else if ("delete".endsWith(eventName)) {
            System.out.println("delete=============");
        }
    }
}

Guess you like

Origin blog.csdn.net/qq_34758074/article/details/90516607