AnsweredAssumed Answered

Execution doesn't exist

Question asked by zaiteki on Jun 23, 2014
Latest reply on Jun 24, 2014 by zaiteki
Hello,

I rarely get following exception when running the activiti flow:

SEVERE: exception during timer execution
org.activiti.engine.ActivitiException: Error while evalutaing expression
        at org.activiti.engine.impl.el.JuelExpression.getValue(JuelExpression.java:59)
        at org.activiti.engine.impl.bpmn.behavior.ServiceTaskExpressionActivityBehavior.execute(ServiceTaskExpressionActivityBehavior.java:45)
        at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:44)
        at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:80)

Caused by: org.activiti.engine.impl.javax.el.ELException: org.activiti.engine.ActivitiException: execution 134401 doesn't exist
        at org.activiti.engine.impl.javax.el.BeanELResolver.invoke(BeanELResolver.java:481)

Caused by: org.activiti.engine.ActivitiException: execution 134401 doesn't exist
        at org.activiti.engine.impl.cmd.GetExecutionVariableCmd.execute(GetExecutionVariableCmd.java:52)
        at org.activiti.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
        at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:42)
        at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)



The exception is generated at following java code location:
<code lang="java">
  @Autowired
  private ProcessEngine engine;

List<ProcessInstance> processInstances = engine.getRuntimeService().createProcessInstanceQuery().list();
    for (ProcessInstance process : processInstances) {
      EntityIdentifier entityIdentifier = (EntityIdentifier) engine.getRuntimeService().getVariable(process.getId(), ENTITY_ID); //exception
      }       
    }
</code>

Generally the code and flow works perfectly but sometimes this error is thrown. It puzzles me since I expect query to return only active processes *unknw*

One more question regarding the roll-back functionality, considering following event handler method:
<code lang="java">
public void event(EntityIdentifier ei){
    db update statement with flush and all that stuff;
    activiti workflow variables update; //exception
}
</code>
Will the DB updates be rolled-back?

I've spent lots of time looking around and analyzing this issue *cray2* running out of ideas already.
Any kind of help will be highly appreciated!

Outcomes