NPE occurs if starting the process from the process form using the following command:
processFormContext.processStarting() .saveInjectedProcessVariables() .start();
See forum