Time for action – starting a new process instance
As we have deployed the process into the Activiti Engine, now we have to start the process instance. For that, we have to perform the following steps:
- To start the process using API, we have to implement the given code in the class file:
// Starting the Deployed Process Date date = new Date(); Map<String, Object> variables = new HashMap<String, Object>(); variables.put("customerName", "Irshad"); variables.put("customerEamil", "firstname.lastname@example.org"); variables.put("trainingTopic", "Activiti"); variables.put("trainingDate", date); RuntimeService runtimeService = processEngine.getRuntimeService(); ProcessInstance processInstance = runtimeService .startProcessInstanceByKey("trainingProcess", ...