Class DefaultEngineRuleDao
java.lang.Object
de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
de.hybris.platform.ruleengine.dao.impl.DefaultEngineRuleDao
- All Implemented Interfaces:
EngineRuleDao,Dao
The default implementation of the Engine Rule Dao.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
flexibleSearchService, modelService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindRulesByCode(String code) Finds AbstractRuleEngineRuleModels by their common code.getActiveRuleByCodeAndMaxVersion(String code, String moduleName, long version) Finds activeAbstractRuleEngineRuleModelby its code and maximum version.getActiveRules(AbstractRulesModuleModel ruleModule) Finds all currently active AbstractRuleEngineRuleModels for a given rule module.getActiveRules(String moduleName) Finds all currently activeAbstractRuleEngineRuleModelfor a given rules module.<T extends AbstractRuleEngineRuleModel>
List<T>getActiveRulesForVersion(String moduleName, long version) Finds currently active rules for the rule module and a given version of knowledge baseReturns the current rules snapshot version number for a given moduleprotected DategetRuleByCode(String code, String moduleName) Finds AbstractRuleEngineRuleModel by its code and module.getRuleByCodeAndMaxVersion(String code, String moduleName, long version) Finds AbstractRuleEngineRuleModel by its code and maximum version.getRuleByUuid(String uuid) retrieve the instance of < T extendsAbstractRuleEngineRuleModel> by UUID<T extends AbstractRuleEngineRuleModel>
List<T>getRulesBetweenVersions(String moduleName, long startVersion, long deployedVersion) Finds all rules for the rule module and between a given start version and old version of knowledge base<T extends AbstractRuleEngineRuleModel>
Collection<T>getRulesByUuids(Collection<String> ruleUuids) <T extends AbstractRuleEngineRuleModel>
List<T>getRulesForVersion(String moduleName, long version) Finds all rules for the rule module and a given version of knowledge baseprotected <T extends AbstractRuleEngineRuleModel>
List<T>getRulesForVersion(String query, Map<String, Object> queryParams, long version) protected AbstractRulesModuleModelgetRuleVersion(String code, String moduleName) Return the last version of a rule with a given code and given moduleprotected TimeServiceprotected AbstractRuleEngineRuleModelgetWithMaximumVersion(FlexibleSearchQuery query, long version) voidsetTimeService(TimeService timeService) Methods inherited from class de.hybris.platform.servicelayer.internal.dao.AbstractItemDao
getAllSources, getFlexibleSearchService, getModelService, getSource, load, loadAll, search, search, searchUnique, setFlexibleSearchService, setModelService
-
Field Details
-
MODULE_NAME
- See Also:
-
RULES_MODULE
- See Also:
-
FROM_ALL_WITH_MODULE_NAME
- See Also:
-
GET_ALL_RULES_QUERY
- See Also:
-
GET_ALL_RULES_FOR_MODULE_QUERY
- See Also:
-
GET_RULE_BY_UUID
- See Also:
-
GET_RULES_BY_MULTIPLE_UUID
- See Also:
-
GET_RULES_BY_CODE
- See Also:
-
GET_RULE_BY_CODE_AND_MODULE
- See Also:
-
GET_MAX_VERSION_FOR_CODE
- See Also:
-
GET_MAX_VERSION_WITH_MODULE
- See Also:
-
GET_ALL_RULES_FOR_VERSION
- See Also:
-
GET_RULES_BETWEEN_VERSIONS
- See Also:
-
GET_ALL_AVAILABLE_KIE_MODULES
- See Also:
-
-
Constructor Details
-
DefaultEngineRuleDao
public DefaultEngineRuleDao()
-
-
Method Details
-
getRuleByUuid
Description copied from interface:EngineRuleDaoretrieve the instance of < T extendsAbstractRuleEngineRuleModel> by UUID- Specified by:
getRuleByUuidin interfaceEngineRuleDao- Parameters:
uuid- the rule uuid- Returns:
- AbstractRuleEngineRuleModel by its uuid. Finds AbstractRuleEngineRuleModel by its uuid.
-
getRulesByUuids
public <T extends AbstractRuleEngineRuleModel> Collection<T> getRulesByUuids(Collection<String> ruleUuids) - Specified by:
getRulesByUuidsin interfaceEngineRuleDao- Type Parameters:
T- type of the expected engine rule instance- Parameters:
ruleUuids- a collection of UUIDs to get the rules for- Returns:
- a Collection if rule models
-
findRulesByCode
Description copied from interface:EngineRuleDaoFinds AbstractRuleEngineRuleModels by their common code.- Specified by:
findRulesByCodein interfaceEngineRuleDao- Parameters:
code- the rule code- Returns:
- list of AbstractRuleEngineRuleModel by its code.
-
getRuleByCode
Description copied from interface:EngineRuleDaoFinds AbstractRuleEngineRuleModel by its code and module.- Specified by:
getRuleByCodein interfaceEngineRuleDao- Parameters:
code- the rule codemoduleName- name of the module- Returns:
- AbstractRuleEngineRuleModel by its code.
-
getRuleByCodeAndMaxVersion
public AbstractRuleEngineRuleModel getRuleByCodeAndMaxVersion(String code, String moduleName, long version) Description copied from interface:EngineRuleDaoFinds AbstractRuleEngineRuleModel by its code and maximum version.- Specified by:
getRuleByCodeAndMaxVersionin interfaceEngineRuleDao- Parameters:
code- the rule codemoduleName- the name of the rules moduleversion- the maximum version of the rule- Returns:
- AbstractRuleEngineRuleModel by its code and maximum version.
-
getActiveRuleByCodeAndMaxVersion
public AbstractRuleEngineRuleModel getActiveRuleByCodeAndMaxVersion(String code, String moduleName, long version) Description copied from interface:EngineRuleDaoFinds activeAbstractRuleEngineRuleModelby its code and maximum version.- Specified by:
getActiveRuleByCodeAndMaxVersionin interfaceEngineRuleDao- Parameters:
code- the rule codemoduleName- the rules module nameversion- the maximum version of the rule- Returns:
- AbstractRuleEngineRuleModel with active=true by its code and maximum version.
-
getActiveRules
Description copied from interface:EngineRuleDaoFinds all currently activeAbstractRuleEngineRuleModelfor a given rules module.- Specified by:
getActiveRulesin interfaceEngineRuleDao- Parameters:
moduleName- the name of the rules module- Returns:
- list of currently active AbstractRuleEngineRuleModel
-
getActiveRules
Description copied from interface:EngineRuleDaoFinds all currently active AbstractRuleEngineRuleModels for a given rule module.- Specified by:
getActiveRulesin interfaceEngineRuleDao- Parameters:
ruleModule- the rule module- Returns:
- list of currently active AbstractRuleEngineRuleModel
-
getCurrentRulesSnapshotVersion
Description copied from interface:EngineRuleDaoReturns the current rules snapshot version number for a given module- Specified by:
getCurrentRulesSnapshotVersionin interfaceEngineRuleDao- Parameters:
ruleModule- the rule module- Returns:
- maximum version number
-
getRuleVersion
Description copied from interface:EngineRuleDaoReturn the last version of a rule with a given code and given module- Specified by:
getRuleVersionin interfaceEngineRuleDao- Parameters:
code- the Rule codemoduleName- the rules module name- Returns:
- last version number of a rule. Null if not found
-
getRulesForVersion
public <T extends AbstractRuleEngineRuleModel> List<T> getRulesForVersion(String moduleName, long version) Description copied from interface:EngineRuleDaoFinds all rules for the rule module and a given version of knowledge base- Specified by:
getRulesForVersionin interfaceEngineRuleDao- Parameters:
moduleName- the rules module nameversion- the KieBase version- Returns:
- list of rules, valid for a given KieBase version
-
getRulesBetweenVersions
public <T extends AbstractRuleEngineRuleModel> List<T> getRulesBetweenVersions(String moduleName, long startVersion, long deployedVersion) Description copied from interface:EngineRuleDaoFinds all rules for the rule module and between a given start version and old version of knowledge base- Specified by:
getRulesBetweenVersionsin interfaceEngineRuleDao- Parameters:
moduleName- the rules module namestartVersion- the start KieBase versiondeployedVersion- the deployed KieBase version- Returns:
- list of rules, valid for between a start and deployed KieBase version
-
getActiveRulesForVersion
public <T extends AbstractRuleEngineRuleModel> List<T> getActiveRulesForVersion(String moduleName, long version) Description copied from interface:EngineRuleDaoFinds currently active rules for the rule module and a given version of knowledge base- Specified by:
getActiveRulesForVersionin interfaceEngineRuleDao- Parameters:
moduleName- the rules module nameversion- the KieBase version- Returns:
- list of rules, valid for a given KieBase version
-
getRulesForVersion
-
getWithMaximumVersion
protected AbstractRuleEngineRuleModel getWithMaximumVersion(FlexibleSearchQuery query, long version) -
getRoundedTimestamp
- Returns:
- the current time, but with seconds set to zero (for FlexibleSearchQuery caching benefits to the minute).
-
getRulesModuleIfOneAvailable
-
getTimeService
-
setTimeService
-