Class DroolsRuleValidateInterceptor
java.lang.Object
de.hybris.platform.droolsruleengineservices.interceptors.DroolsRuleValidateInterceptor
- All Implemented Interfaces:
Interceptor,ValidateInterceptor<DroolsRuleModel>
public class DroolsRuleValidateInterceptor
extends Object
implements ValidateInterceptor<DroolsRuleModel>
Validates the DroolsRule item type. Validations are described below and can be disabled by setting the respective
property to
false:
Check that DroolsRule.code doesn't contain double-quote (") and that @ruleCode meta-data is present
in DroolsRule.drl and matches DroolsRule.code:
droolsruleengineservices.validate.droolsrule.rulecode
Check that @moduleName meta-data is present
in DroolsRule.drl and matches AbstractRulesModule.name:
droolsruleengineservices.validate.droolsrule.rulecode
Check for DroolsRule.uuid doesn't contain double-quote(") and that it matches the DroolsRule.drl rule
declaration ( using double-quotes around the rule, e.g. rule "this is the rule uuid"):
droolsruleengineservices.validate.droolsrule.rulename
Check that DroolsRule.rulePackage attribute (if set) matches the package declaration in the
DroolsRule.drl content: droolsruleengineservices.validate.droolsrule.rulepackage-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected List<DroolsRuleModel>protected ConfigurationServiceprotected DroolsStringUtilsprotected EngineRuleDaoprotected L10NServiceprotected BiPredicate<DroolsRuleModel,DroolsRuleModel> voidonValidate(DroolsRuleModel model, InterceptorContext ctx) Called in themodelService.saveAll()method.voidsetConfigurationService(ConfigurationService configurationService) voidsetDroolsStringUtils(DroolsStringUtils droolsStringUtils) voidsetEngineRuleDao(EngineRuleDao engineRuleDao) voidsetL10NService(L10NService l10NService) voidsetSameNameAndPackageBiPredicate(BiPredicate<DroolsRuleModel, DroolsRuleModel> sameNameAndPackageBiPredicate) protected voidprotected voidprotected voidprotected voidprotected voidvalidateRuleCode(DroolsRuleModel model) protected voidvalidateRuleName(DroolsRuleModel model)
-
Constructor Details
-
DroolsRuleValidateInterceptor
public DroolsRuleValidateInterceptor()
-
-
Method Details
-
onValidate
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
-
validateContentForRuleName
- Throws:
InterceptorException
-
validateContentForRulePackage
- Throws:
InterceptorException
-
validateContentForModuleName
- Throws:
InterceptorException
-
validateContentForRuleCode
- Throws:
InterceptorException
-
validateRuleName
- Throws:
InterceptorException
-
validateRuleCode
- Throws:
InterceptorException
-
getSameNameAndPackageBiPredicate
-
setSameNameAndPackageBiPredicate
public void setSameNameAndPackageBiPredicate(BiPredicate<DroolsRuleModel, DroolsRuleModel> sameNameAndPackageBiPredicate) -
getConfigurationService
-
setConfigurationService
-
getEngineRuleDao
-
setEngineRuleDao
-
getL10NService
-
setL10NService
-
getDroolsStringUtils
-
setDroolsStringUtils
-