Adds the cp rule to the database. Also notifies the appropriate model listeners.

@param cpRule the cp rule
@return the cp rule that was added
423226
public static com.liferay.commerce.product.model.CPRule addCPRule(
		com.liferay.commerce.product.model.CPRule cpRule) {
		return getService().addCPRule(cpRule);
	}
1110214
@Override
	public void cacheResult(CPRule cpRule) {
		entityCache.putResult(CPRuleModelImpl.ENTITY_CACHE_ENABLED,
			CPRuleImpl.class, cpRule.getPrimaryKey(), cpRule);

		cpRule.resetOriginalValues();
	}
1005740
public ShardingStrategy getDatabaseShardingStrategy(final TableRule tableRule) {
        return null == tableRule.getDatabaseShardingStrategy() ? defaultDatabaseShardingStrategy : tableRule.getDatabaseShardingStrategy();
    }
1372879
public <RO> SingleRuleContext<DPO, Collection<DPO>, RO> check(Rule<Collection<DPO>, RO> rule) {
        List<Rule<Collection<DPO>, RO>> addedRules = new ArrayList<Rule<Collection<DPO>, RO>>();
        if (rule != null) {
            addedRules.add(rule);
        }

        // Change context
        return new SingleRuleContext<DPO, Collection<DPO>, RO>(addedTriggers, addedDataProviders,
                GeneralValidator.MappingStrategy.JOIN, null, addedRules);
    }
1176076
public static com.liferay.commerce.model.CPDAvailabilityEstimate addCPDAvailabilityEstimate(
		com.liferay.commerce.model.CPDAvailabilityEstimate cpdAvailabilityEstimate) {
		return getService().addCPDAvailabilityEstimate(cpdAvailabilityEstimate);
	}
84503
@Override
	public CPRuleUserSegmentRel create(long CPRuleUserSegmentRelId) {
		CPRuleUserSegmentRel cpRuleUserSegmentRel = new CPRuleUserSegmentRelImpl();

		cpRuleUserSegmentRel.setNew(true);
		cpRuleUserSegmentRel.setPrimaryKey(CPRuleUserSegmentRelId);

		cpRuleUserSegmentRel.setCompanyId(companyProvider.getCompanyId());

		return cpRuleUserSegmentRel;
	}
828355
public void addPropertyItemRule(ItemRule propertyItemRule) {
        if (propertyItemRuleMap == null) {
            propertyItemRuleMap = new ItemRuleMap();
        }
        propertyItemRuleMap.putItemRule(propertyItemRule);
    }
740129
def add_subrule(self, subrule, weight):
        
        if not issubclass(subrule.__class__, (Rule, RuleLeaf)):
            raise TypeError("Rule's class must be (subclass of) {} or {}, got "
                            "{}.".format(Rule, RuleLeaf, subrule.__class__))
        self.__domains = set.union(self.__domains, subrule.domains)
        self.R.append(subrule)
        self.W.append(weight)
448358
public static com.liferay.commerce.product.model.CPRule createCPRule(
		long CPRuleId) {
		return getService().createCPRule(CPRuleId);
	}
990020
def addRule( self, rule ):
        
        self._rules[rule.term()] = rule
        self.updateRules()
1024356
public SimpleFieldValidation addRule(ExecutionPath fieldPath, BiFunction<FieldAndArguments, FieldValidationEnvironment, Optional<GraphQLError>> rule) {
        rules.put(fieldPath, rule);
        return this;
    }
1313355
@Nonnull
  public CascadingStyleSheet addImportRule (@Nonnull final CSSImportRule aImportRule)
  {
    ValueEnforcer.notNull (aImportRule, "ImportRule");

    m_aImportRules.add (aImportRule);
    return this;
  }
529259
protected boolean alreadyResettingRule(final RuleContext rc)
	{
		if (m_resettingRules.contains(rc))
		{
		    return true;
		}
		m_resettingRules.add(rc);
		return false;
	}
1120639
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CPRuleUserSegmentRel addCPRuleUserSegmentRel(
		CPRuleUserSegmentRel cpRuleUserSegmentRel) {
		cpRuleUserSegmentRel.setNew(true);

		return cpRuleUserSegmentRelPersistence.update(cpRuleUserSegmentRel);
	}
865184
public static com.liferay.commerce.product.model.CPRuleUserSegmentRel createCPRuleUserSegmentRel(
		long CPRuleUserSegmentRelId) {
		return getService().createCPRuleUserSegmentRel(CPRuleUserSegmentRelId);
	}
619976
@Override
	@Transactional(enabled = false)
	public CPRule createCPRule(long CPRuleId) {
		return cpRulePersistence.create(CPRuleId);
	}
1360233
public MultipleRuleContext<DPO, RI, RO> check(Rule<RI, RO> rule) {
        if (rule != null) {
            addedRules.add(rule);
        }

        // Stay in the same context and re-use the same instance because no type has changed
        return this;
    }