Is the processEngine available in a script task?

Hi,

We a migrating from an activiti stack to flowable and we have scripts running that use the processEngine and they look like this:

import org.activiti.engine.runtime.ExecutionQuery;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.runtime.Execution;

RuntimeService runtimeService = processEngine.getRuntimeService();
List<Execution> executions = 
   runtimeService.createExecutionQuery()
      .variableValueEquals("MyVar", MyVar).list();

If we run this in activiti, all is well. If we run this script in Flowable we can a 500 error saying No such property: processEngine for class:

import org.flowable.engine.runtime.ExecutionQuery;
import org.flowable.engine.RuntimeService;
import org.flowable.engine.runtime.Execution;

RuntimeService runtimeService = processEngine.getRuntimeService();
List<Execution> executions = 
   runtimeService.createExecutionQuery()
      .variableValueEquals("MyVar", MyVar).list();

Is it expected behaviour that we can no longer use this in flowable?

This may answer your question: Flowable Migration Guide : Flowable or Activiti v5 to Flowable V6 ยท Flowable Open Source Documentation