Я пытаюсь приостановить экземпляр процесса для взаимодействия с пользователем, чтобы выполнить действие, например, принять или отклонить поток процесса.
public class UserWorkflowTaskListener implements ExecutionListener {
@Override
public void notify(DelegateExecution execution) {
runtimeService.suspendProcessInstanceById(execution.getProcessInstanceId());
}
}
, но выдает ошибку
2019-09-23 16:48:01.524 ERROR 26851 — [enerContainer-1] o.f.c.e.impl.interceptor.CommandContext : Error while closing command context
java.lang.NullPointerException: null
at com.rpa.core.process.tasklistener.UserWorkflowTaskListener.notify(UserWorkflowTaskListener.java:75) ~[classes/:na]
at org.flowable.engine.impl.delegate.invocation.ExecutionListenerInvocation.invoke(ExecutionListenerInvocation.java:35) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.delegate.invocation.DelegateInvocation.proceed(DelegateInvocation.java:35) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.delegate.invocation.DefaultDelegateInterceptor.handleInvocation(DefaultDelegateInterceptor.java:26) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.bpmn.helper.ClassDelegate.notify(ClassDelegate.java:99) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.bpmn.listener.ListenerNotificationHelper.executeExecutionListeners(ListenerNotificationHelper.java:79) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.agenda.AbstractOperation.executeExecutionListeners(AbstractOperation.java:78) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.agenda.AbstractOperation.executeExecutionListeners(AbstractOperation.java:69) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.agenda.ContinueProcessOperation.executeSynchronous(ContinueProcessOperation.java:141) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.agenda.ContinueProcessOperation.continueThroughFlowNode(ContinueProcessOperation.java:113) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.agenda.ContinueProcessOperation.continueThroughSequenceFlow(ContinueProcessOperation.java:311) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.agenda.ContinueProcessOperation.run(ContinueProcessOperation.java:79) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:88) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:72) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:56) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:25) ~[flowable-engine-6.4.0.jar:6.4.0]
at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53) ~[flowable-engine-common-6.4.0.jar:6.4.0]
at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:71) ~[flowable-engine-common-6.4.0.jar:6.4.0]
at org.flowable.common.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:49) [flowable-spring-common-6.4.0.jar:6.4.0]
at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:140) [spring-tx-5.1.8.RELEASE.jar:5.1.8.RELEASE]
at org.flowable.common.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:46) [flowable-spring-common-6.4.0.jar:6.4.0]
at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30) [flowable-engine-common-6.4.0.jar:6.4.0]
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56) [flowable-engine-common-6.4.0.jar:6.4.0]
at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51) [flowable-engine-common-6.4.0.jar:6.4.0]