Retrieve executionId inside CommandInterceptor

cancel
Showing results for 
Search instead for 
Did you mean: 
louisp
Member II

Retrieve executionId inside CommandInterceptor

I am implementing my own Activiti command intereceptor like this :

public class ActivitiCommandInterceptor extends AbstractCommandInterceptor {
    private RuntimeService runtimeService;
    private CommandInterceptor delegate;

    public ActivitiSpringTxCommandInterceptor(RuntimeService runtimeService, CommandInterceptor delegate) {
        this.runtimeService = runtimeService;
        this.delegate=delegate;
     }

     @Override
    public <T> T execute(CommandConfig config, Command<T> command) {
        String myVariable = runtimeService.getVariable(<missingExecutionId>, "myVariableName");

        ...
    }
}

Inside the `execute()` method I need to retrieve a variable from the execution context related to this command.

To do that, I need to have the `executionId`, but I can't find a way to retrieve it.

How can I get my variable from this interceptor?

Thanks