dengzedong
2024-12-24 76743b009ca5ea67557fcab597b332f8d1947813
提交 | 用户 | 时间
e7c126 1 package com.iailab.module.bpm.framework.flowable.core.listener.demo.exection;
H 2
3 import lombok.extern.slf4j.Slf4j;
49b4b6 4 import org.apache.commons.lang3.ObjectUtils;
H 5 import org.flowable.bpmn.model.FieldExtension;
e7c126 6 import org.flowable.engine.delegate.DelegateExecution;
H 7 import org.flowable.engine.delegate.JavaDelegate;
49b4b6 8
H 9 import java.util.List;
e7c126 10
H 11 /**
12  * 类型为 class 的 ExecutionListener 监听器示例
13  *
14  * @author iailab
15  */
16 @Slf4j
17 public class DemoDelegateClassExecutionListener implements JavaDelegate {
18
19     @Override
20     public void execute(DelegateExecution execution) {
49b4b6 21         log.info("[execute][execution({}) 执行监听器(类)被调用!变量有:{}]", execution.getId(),
e7c126 22                 execution.getCurrentFlowableListener().getFieldExtensions());
49b4b6 23         List<FieldExtension> fieldExtensions = execution.getCurrentFlowableListener().getFieldExtensions();
H 24         if(ObjectUtils.isNotEmpty(fieldExtensions)) {
25             fieldExtensions.stream().forEach(fieldExtension -> {
26                 System.out.println(fieldExtension.getFieldName());
27                 System.out.println(fieldExtension.getExpression());
28             });
29         }
e7c126 30     }
H 31
32 }