Class DroolsRuleValidateInterceptor
- java.lang.Object
-
- de.hybris.platform.droolsruleengineservices.interceptors.DroolsRuleValidateInterceptor
-
- All Implemented Interfaces:
Interceptor,ValidateInterceptor<DroolsRuleModel>
public class DroolsRuleValidateInterceptor extends java.lang.Object implements ValidateInterceptor<DroolsRuleModel>
Validates the DroolsRule item type. Validations are described below and can be disabled by setting the respective property tofalse: Check thatDroolsRule.codedoesn't contain double-quote (") and that@ruleCodemeta-data is present inDroolsRule.drland matchesDroolsRule.code:droolsruleengineservices.validate.droolsrule.rulecodeCheck that@moduleNamemeta-data is present inDroolsRule.drland matchesAbstractRulesModule.name:droolsruleengineservices.validate.droolsrule.rulecodeCheck forDroolsRule.uuiddoesn't contain double-quote(") and that it matches theDroolsRule.drlrule declaration ( using double-quotes around the rule, e.g.rule "this is the rule uuid"):droolsruleengineservices.validate.droolsrule.rulenameCheck thatDroolsRule.rulePackageattribute (if set) matches the package declaration in theDroolsRule.drlcontent:droolsruleengineservices.validate.droolsrule.rulepackage
-
-
Constructor Summary
Constructors Constructor Description DroolsRuleValidateInterceptor()
-
Method Summary
-
-
-
Method Detail
-
onValidate
public void onValidate(DroolsRuleModel model, InterceptorContext ctx) throws InterceptorException
Description copied from interface:ValidateInterceptorCalled in themodelService.saveAll()method. Validates the values of the given model.- Specified by:
onValidatein interfaceValidateInterceptor<DroolsRuleModel>- Parameters:
model- the model which values has to be validatedctx- theInterceptorContext- Throws:
InterceptorException- if any values of the model are not valid.
-
getActiveRules
protected java.util.List<DroolsRuleModel> getActiveRules(DroolsKIEBaseModel base)
-
validateContentForRuleName
protected void validateContentForRuleName(DroolsRuleModel model) throws InterceptorException
- Throws:
InterceptorException
-
validateContentForRulePackage
protected void validateContentForRulePackage(DroolsRuleModel model) throws InterceptorException
- Throws:
InterceptorException
-
validateContentForModuleName
protected void validateContentForModuleName(DroolsRuleModel model) throws InterceptorException
- Throws:
InterceptorException
-
validateContentForRuleCode
protected void validateContentForRuleCode(DroolsRuleModel model) throws InterceptorException
- Throws:
InterceptorException
-
validateRuleName
protected void validateRuleName(DroolsRuleModel model) throws InterceptorException
- Throws:
InterceptorException
-
validateRuleCode
protected void validateRuleCode(DroolsRuleModel model) throws InterceptorException
- Throws:
InterceptorException
-
getSameNameAndPackageBiPredicate
protected java.util.function.BiPredicate<DroolsRuleModel,DroolsRuleModel> getSameNameAndPackageBiPredicate()
-
setSameNameAndPackageBiPredicate
public void setSameNameAndPackageBiPredicate(java.util.function.BiPredicate<DroolsRuleModel,DroolsRuleModel> sameNameAndPackageBiPredicate)
-
getConfigurationService
protected ConfigurationService getConfigurationService()
-
setConfigurationService
public void setConfigurationService(ConfigurationService configurationService)
-
getEngineRuleDao
protected EngineRuleDao getEngineRuleDao()
-
setEngineRuleDao
public void setEngineRuleDao(EngineRuleDao engineRuleDao)
-
-