Execution variable in end listener

Hey,

In a service task if i set a variable in the output mapping like this:

Name: variable
Type: Text
Value: ${execution.getVariable(“some_variable_which_i_calculated_in_the_service_task”)}
// this variable also set inside the sevice task

Than If I write an “end” execution listener with a script listener type which prints the variable’s value, it’s null. In the next task after the service task although I can get it’s value normally.
Is this a bug or a feature?

Hey Ezolnbl,

is it possible that you post your model and code to clarify your question?

Best regards,

Chris

Inside the service I simply save the result of an external service call like this:

execution.setVariables(resultMap);

The Service class is a DelegateExpression type so its under spring scope and annotated with @Service. Nothing fancy at all.

Hi Zoltán,

Trying to get the value of the variable at an “end” execution listener of a service task wouldn’t work as the transaction is not yet committed to the database

Please see below post

and below link