saveOrUpdate(packageDef);
}
@Override
public void addAppParticipant(String appId, Long appVersion, PackageParticipant participant) {
PackageDefinition packageDef = loadAppPackageDefinition(appId, appVersion);
if (packageDef == null) {
AppDefinition appDef = getAppDefinitionDao().loadVersion(appId, appVersion);
packageDef = createPackageDefinition(appDef, appVersion);
}
String processDefId = participant.getProcessDefId();
processDefId = WorkflowUtil.getProcessDefIdWithoutVersion(processDefId);
participant.setProcessDefId(processDefId);
String participantId = participant.getParticipantId();
if (processDefId != null && participantId != null) {
packageDef.removePackageParticipant(processDefId, participantId);
saveOrUpdate(packageDef);
}
packageDef.addPackageParticipant(participant);
saveOrUpdate(packageDef);
}