赞
踩
activiti执行监听器executionListener Expression用法
解决方法:
使用Expression的方式来为开始节点设置监听器处理类,方法表达式Expression内容:${myExecutionListener2.notify2(execution,authenticatedUserId)},如下所示
<startEvent id="_2" name="StartEvent">
<extensionElements>
<activiti:executionListener event="start" expression="${myExecutionListener2.notify2(execution,authenticatedUserId)}"/>
</extensionElements>
</startEvent>
1.执行监听器executionListener处理类代码,spring会自动注入到activiti表达式${myExecutionListener2.notify2(execution,authenticatedUserId)}中的myExecutionListener2:
@Service
public class MyExecutionListener2{
private static final long serialVersionUID = 8513750196548027535L;
public void notify2(DelegateExecution execution,String startUserId) throws Exception {
System.out.println("开始节点" );
}
}
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。