((ExecutionEntity) currentExecution).getTasks() throws NullPointerException

Hi, am i using the queries out of context?

I use runtimeService.createExecutionQuery() to find an Execution.
execution.getTasks() throws NullPointerException because processEngineConfiguration is null in the method below.

`protected void ensureTasksInitialized() {
    if (tasks == null) {
        ProcessEngineConfigurationImpl processEngineConfiguration = CommandContextUtil.getProcessEngineConfiguration();
        tasks = processEngineConfiguration.getTaskServiceConfiguration().getTaskService().findTasksByExecutionId(id);
    }
}`

Why would that be when the execution is still active?

Can you share what method you are calling on the execution object?

But irregardless, these kind of methods only work when running in a command context (i.e. active operation with database transaction). You can wrap it in a custom command through the ManagementService#executeCommand()