In my project there is an existing old.jpdl.xml definition. It is working fine. Now I want to run another new.jpdl.xml definition. After deployment of ear file I tried to read new.jpdl.xml using new ProcessDefinitionId with help of below code.
I believe that I am missing deployment steps. Can someone guide me, how to deploy or read new.jpdl.xml?
public String getProcessInstanceID(ProcessEngine processEngine,
FlowControl flowcontrol, String processDefinitionID)
{
String processInstanceID = null;
log.debug("Entering method - getProcessInstanceID");
ProcessDefinitionQuery pdq = processEngine.getRepositoryService()
.createProcessDefinitionQuery();
pdq.deploymentId(processDefinitionID);
ProcessDefinition procDef = pdq.uniqueResult();
if (null == procDef)
{
log.error("Process Definition could not be found for the deployment ID: "
+ processDefinitionID);
}
Map<String, Object> variables = new HashMap<String, Object>();
variables.put("flowcontrol", flowcontrol);
ProcessInstance processInstance = processEngine.getExecutionService()
.startProcessInstanceByKey(procDef.getKey(), variables);
log.debug("Process Instance ID:" + processInstance.getId());
processInstanceID = processInstance.getId();
log.debug("Exiting method - getProcessInstanceID");
return processInstanceID;
}