cancel
Showing results for 
Search instead for 
Did you mean: 

Java exception when calling runtimeService.getVariables

dwoodbury
Champ in-the-making
Champ in-the-making
I added ${runtimeServer.getVariables(execution.getId())} to the documentation section of a user task and received the following exception:

PM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.activiti.engin.ActivitiException: execution 14848 doesn't exist.

Additional Information:

1. The user-task is the first task after the process' start event
2. If I add the script to the documentation section of a later user task, it returns the process variables.
2 REPLIES 2

meyerd
Champ on-the-rise
Champ on-the-rise
Hi dwoodbury,

use
${execution.getVariables()}
If you use the runtimeService, you are looking up the execution in the database and as this is the first transaction, the execution is not yet committed.

dwoodbury
Champ in-the-making
Champ in-the-making
Thanks - that works!

Are there any other classes that can be used from within task scripts? I'm not sure how to discover those things.  For example,  I tried ${task.getAssignee()} but that resulted in an unknown property exception.