当前位置:   article > 正文

activiti的ExecutionListener  Expression用法_executionlistener private expression

executionlistener private expression

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("开始节点" );

   }

 

}

 

2.启动流程:http://www.yayihouse.com/yayishuwu/chapter/2305

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/468502
推荐阅读
相关标签
  

闽ICP备14008679号