@Override public MDRRuleGroup addRuleGroup( long groupId, Map<Locale, String> nameMap, Map<Locale, String> descriptionMap, ServiceContext serviceContext) throws PortalException, SystemException { User user = userPersistence.findByPrimaryKey(serviceContext.getUserId()); Date now = new Date(); long ruleGroupId = counterLocalService.increment(); MDRRuleGroup ruleGroup = createMDRRuleGroup(ruleGroupId); ruleGroup.setUuid(serviceContext.getUuid()); ruleGroup.setGroupId(groupId); ruleGroup.setCompanyId(serviceContext.getCompanyId()); ruleGroup.setCreateDate(serviceContext.getCreateDate(now)); ruleGroup.setModifiedDate(serviceContext.getModifiedDate(now)); ruleGroup.setUserId(user.getUserId()); ruleGroup.setUserName(user.getFullName()); ruleGroup.setNameMap(nameMap); ruleGroup.setDescriptionMap(descriptionMap); return updateMDRRuleGroup(ruleGroup); }
public MDRRuleGroup updateRuleGroup( long ruleGroupId, Map<Locale, String> nameMap, Map<Locale, String> descriptionMap, ServiceContext serviceContext) throws PortalException, SystemException { MDRRuleGroup ruleGroup = mdrRuleGroupPersistence.findByPrimaryKey(ruleGroupId); ruleGroup.setModifiedDate(serviceContext.getModifiedDate(null)); ruleGroup.setNameMap(nameMap); ruleGroup.setDescriptionMap(descriptionMap); mdrRuleGroupPersistence.update(ruleGroup, false); return ruleGroup; }