dengzedong
2024-12-24 aa0382e44311f9f7e62a688c8fcaa9c69a512e0f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package com.iailab.module.bpm.framework.flowable.core.listener.demo.task;
 
import lombok.extern.slf4j.Slf4j;
import org.flowable.engine.delegate.TaskListener;
import org.flowable.task.service.delegate.DelegateTask;
import org.springframework.stereotype.Component;
 
import java.util.Map;
 
/**
 * 类型为 delegateExpression 的 TaskListener 监听器示例
 *
 * @author iailab
 */
@Component
@Slf4j
public class DemoDelegateExpressionTaskListener implements TaskListener {
 
    @Override
    public void notify(DelegateTask delegateTask) {
        log.info("[execute][task({}) 任务监听器(委托表达式)被调用]", delegateTask.getId());
        Map<String, Object> variables = delegateTask.getVariables();
        System.out.println(variables.toString());;
    }
 
}