In my project, there is an existing definition of old.jpdl.xml. It is working fine. Now I want to run another definition of new.jpdl.xml. After deploying the ear file, I tried to read new.jpdl.xml using the new ProcessDefinitionId using the code below.
I believe that I am missing the deployment steps. Can someone help 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; }
source share