saveOrUpdate(packageDef);
}
@Override
public void addAppActivityPlugin(String appId, Long appVersion, PackageActivityPlugin activityPlugin) {
PackageDefinition packageDef = loadAppPackageDefinition(appId, appVersion);
if (packageDef == null) {
AppDefinition appDef = getAppDefinitionDao().loadVersion(appId, appVersion);
packageDef = createPackageDefinition(appDef, appVersion);
}
String processDefId = activityPlugin.getProcessDefId();
processDefId = WorkflowUtil.getProcessDefIdWithoutVersion(processDefId);
activityPlugin.setProcessDefId(processDefId);
String activityDefId = activityPlugin.getActivityDefId();
if (processDefId != null && activityDefId != null) {
packageDef.removePackageActivityPlugin(processDefId, activityDefId);
saveOrUpdate(packageDef);
}
packageDef.addPackageActivityPlugin(activityPlugin);
saveOrUpdate(packageDef);
}