1. bpmn中相关的定义:
<extensionElements>
<activiti:executionListener event="start" delegateExpression="${processStartListener}"></activiti:executionListener>
<activiti:executionListener event="end" delegateExpression="${processEndListener}"></activiti:executionListener>
</extensionElements>
2. ProcessStartListener的定义:
@IocBean
public class ProcessStartListener implements ExecutionListener {
@Override
public void notify(DelegateExecution execution) throws Exception {
System.out.println(execution.getProcessBusinessKey());
System.out.println(execution.getProcessInstanceId());
}
}
3. 报错信息
org.activiti.engine.ActivitiException: Unknown property used in expression: ${processStartListener}
at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:53)
at org.activiti.engine.impl.bpmn.listener.DelegateExpressionExecutionListener.notify(DelegateExpressionExecutionListener.java:45)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:42)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:97)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:650)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:643)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.start(ExecutionEntity.java:388)
Caused by: org.activiti.engine.impl.javax.el.PropertyNotFoundException: Cannot resolve identifier 'processStartListener'
at org.activiti.engine.impl.juel.AstIdentifier.eval(AstIdentifier.java:83)
at org.activiti.engine.impl.juel.AstEval.eval(AstEval.java:50)
at org.activiti.engine.impl.juel.AstNode.getValue(AstNode.java:26)
at org.activiti.engine.impl.juel.TreeValueExpression.getValue(TreeValueExpression.java:114)
at org.activiti.engine.impl.delegate.ExpressionGetInvocation.invoke(ExpressionGetInvocation.java:33)
at org.activiti.engine.impl.delegate.DelegateInvocation.proceed(DelegateInvocation.java:37)
at org.activiti.engine.impl.delegate.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:25)
at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:50)
... 84 more