ProcessDefinitionEntity processDefinitionEntity = new GetDeploymentProcessDefinitionCmd(
processDefinitionId).execute(commandContext);
String processDefinitionKey = processDefinitionEntity.getKey();
int processDefinitionVersion = processDefinitionEntity.getVersion();
BpmConfBaseManager bpmConfBaseManager = getBpmConfBaseManager();
BpmConfBase bpmConfBase = bpmConfBaseManager
.findUnique(
"from BpmConfBase where processDefinitionKey=? and processDefinitionVersion=?",
processDefinitionKey, processDefinitionVersion);
if (bpmConfBase == null) {
bpmConfBase = new BpmConfBase();
bpmConfBase.setProcessDefinitionId(processDefinitionId);
bpmConfBase.setProcessDefinitionKey(processDefinitionKey);
bpmConfBase.setProcessDefinitionVersion(processDefinitionVersion);
bpmConfBaseManager.save(bpmConfBase);
} else if (bpmConfBase.getProcessDefinitionId() == null) {
bpmConfBase.setProcessDefinitionId(processDefinitionId);
bpmConfBaseManager.save(bpmConfBase);
}
BpmnModel bpmnModel = new GetBpmnModelCmd(processDefinitionId)
.execute(commandContext);