在我的项目中有一个现有的 old.jpdl.xml 定义。它工作正常。现在我想运行另一个 new.jpdl.xml 定义。部署 ear 文件后,我尝试在下面的代码的帮助下使用 new ProcessDefinitionId 读取 new.jpdl.xml。
我相信我缺少部署步骤。有人可以指导我,如何部署或阅读 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;
}