What is this exception? "At least one instantiation instruction required"

Hello Team,

I am getting this exception when I try to test a .bpmn process.

org.camunda.bpm.engine.ProcessEngineException: At least one instantiation instruction required (e.g. by invoking startBefore(…), startAfter(…) or startTransition(…)): instructions is empty
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.camunda.bpm.engine.impl.util.EnsureUtil.generateException(EnsureUtil.java:329)
at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotEmpty(EnsureUtil.java:120)
at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotEmpty(EnsureUtil.java:113)
at org.camunda.bpm.engine.impl.cmd.StartProcessInstanceAtActivitiesCmd.execute(StartProcessInstanceAtActivitiesCmd.java:75)

The process works fine when called from within a caseInstance, as a reference to a ProcessTask in CMMN.
But when i try to use Arquillian to test the .bpmn file individually, i get the above exception.
What am I doing wrong?

Here is the test case:

@Inject
ProcessEngine processEngine;

@Test
public void testAssign_Auto_Callout_Process_Task(){
assertNotNull(processEngine);
String processFile=“processes/Courier_Assign_SO_Change_Process_Task.bpmn”;
String PROCESS_DEFINITION_KEY=“Courier_Assignment_SO_Change_Process_Task”;
String bk=“test1”;
cleanUpRunningProcessInstances(PROCESS_DEFINITION_KEY);
RepositoryService repoService = processEngine.getRepositoryService();
RuntimeService runtimeSvc = processEngine.getRuntimeService();
org.camunda.bpm.engine.repository.Deployment deployment = repoService.createDeployment().addClasspathResource(processFile).deploy();
assertNotNull(deployment);
ProcessInstance pinst = runtimeSvc.createProcessInstanceByKey(PROCESS_DEFINITION_KEY).businessKey(bk).execute();
assertNotNull(pinst);
assertTrue(pinst.getBusinessKey().equals(bk));
}

Any pointers as to why the above exception might be occuring.

Thanks and regards,
Subhro.

Hi Subhro,

you can create a process instance using the following command:

runtimeService.startProcessInstanceByKey(key);

The command you use is for process instance migration when you want to start a process instance at any activity (not the start event).

In Camunda 7.5, you can use this command also to start a process instance at the start event.

Greetings,
Philipp

Thanks a lot Philip, i got it to work.

Regards,
Subhro.