AnsweredAssumed Answered

Process instance behavior change on the fly

Question asked by tomekzaremba on Feb 8, 2016
Latest reply on Feb 9, 2016 by tomekzaremba

I'm trying to provide the "goto" solution for running process instance. It should be available as rest endpoint (Activiti is integrated with Spring Boot). Purpose of that is to modify standard process execution in case of e.g. error in one of the service task or retry some already completed task.

I tried following snippet of code:

final ProcessDefinitionImpl definition = (ProcessDefinitionImpl) repositoryService //
        final ExecutionEntity execution = (ExecutionEntity) runtimeService.createExecutionQuery() //
                .executionId(data.getExecutionId()) //

        final ActivityImpl desiredActivity = definition.findActivity(data.getActivityId());


but it ends with following NPE:

Caused by: java.lang.NullPointerException: null
   at org.activiti.engine.impl.history.handler.ActivityInstanceStartHandler.notify( ~[activiti-engine-]
   at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute( ~[activiti-engine-]
   at ~[classes/:na]

Can anyone can give me some hint how to implement such mechanism? Of course this has to change only given by my process instance - whole process definition should be unchanged.