| | |
| | | package com.iailab.module.bpm.framework.flowable.core.listener.demo.exection; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.ObjectUtils; |
| | | import org.flowable.bpmn.model.FieldExtension; |
| | | import org.flowable.engine.delegate.DelegateExecution; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 类型为 expression 的 ExecutionListener 监听器示例 |
| | |
| | | public class DemoSpringExpressionExecutionListener { |
| | | |
| | | public void execute(DelegateExecution execution) { |
| | | log.info("[execute][execution({}) 被调用!变量有:{}]", execution.getId(), |
| | | log.info("[execute][execution({}) 执行监听器(spring表达式)被调用!变量有:{}]", execution.getId(), |
| | | execution.getCurrentFlowableListener().getFieldExtensions()); |
| | | List<FieldExtension> fieldExtensions = execution.getCurrentFlowableListener().getFieldExtensions(); |
| | | if(ObjectUtils.isNotEmpty(fieldExtensions)) { |
| | | fieldExtensions.stream().forEach(fieldExtension -> { |
| | | System.out.println(fieldExtension.getFieldName()); |
| | | System.out.println(fieldExtension.getExpression()); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | } |