Restart the process and throw an exception

I restart the process through method restartProcessInstances;

runtimeServive.restartProcessInstances(processDefinitionId)
.processInstanceIds(processInstanceId)
.startBeforeActivity(activeId1)
.startBeforeActivity(activeId2)
.startBeforeActivity(activeId3)
execute();

throw exception:
Unknown property used in expression: ${test}. Cause: Cannot resolve identifier ‘test’.

If there is only one Active restart,No problem, Can run.

runtimeServive.restartProcessInstances(processDefinitionId)
.processInstanceIds(processInstanceId)
.startBeforeActivity(activeId1)
execute();

Can you upload your process model?

ok,I restarted back_sub.bpmn and threw an exception.
The test variable is set at the start of the process.
back_sub.bpmn (6.5 KB)
goBreak.bpmn (6.8 KB)

Looks like you’re just missing the required variable test which should be the candidate user.
This must not have been in the original run of the instance, but if it was present then you can add it with an additional line to the code

runtimeService.restartProcessInstances("ProcessDef")
	  .initialSetOfVariables()
	  .processInstanceIds("processinstance")
	  .startBeforeActivity("actKey1")
	  .startBeforeActivity("actKey2")
	  .startBeforeActivity("actKey3")
	  .execute();

No, or throw an exception.
Unknown property used in expression: ${test}. Cause: Cannot resolve identifier ‘test’

I don’t know why only one ActivityId can run on reboot. Setting more than two will cause errors

runtimeService.restartProcessInstances("ProcessDef")
  .initialSetOfVariables()
  .processInstanceIds("processinstance")
  .startBeforeActivity("actKey1")
  .execute();

There are test variables before restarting.

Is this a bug?

I checked the source code.
When starting the process, only variables are set to the last element of options, resulting in errors at startup time.