Class MatchEngine
java.lang.Object
com.aquima.interactions.matching.impl.model.MatchEngine
- All Implemented Interfaces:
IMatchEngine
Actual match engine implementation.
- Since:
- 6.2
- Author:
- O. Kerpershoek, F. van der Meer
-
Constructor Summary
ConstructorsConstructorDescriptionMatchEngine
(IMetaModel model, IMatchEngineDS datasource, IMatchTypeFactory factory, IResourceManager resources, ILicenseProvider licenseProvider) Constructs the match engine using the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
This method must be called to apply any modifications in the case data to the match engine.detailMatch
(IMatchRequest request, String caseId) This method may be used to match the request against a specific case, in order to get a detailed matched result explaining how each value of the request matches against the values of the case.getCaseBase
(String entityName) This method returns the casebase for the specified entity type name.getMatchFunction
(String functionName) This method returns the match function as defined in studio.protected MatchFunctionList
getMutableCaseBase
(String entityName) This method returns the mutable casebase for the specified entity type name.protected boolean
hasCaseBase
(String entityName) match
(IMatchRequest request) This method matches the request against the internal casebase and returns the match result containing the matching cases.
-
Constructor Details
-
MatchEngine
public MatchEngine(IMetaModel model, IMatchEngineDS datasource, IMatchTypeFactory factory, IResourceManager resources, ILicenseProvider licenseProvider) Constructs the match engine using the provided parameters.- Parameters:
model
- The meta model containing the attribute definitions.datasource
- Data source providing the match configuration.factory
- Optional match type factory for custom match functions.resources
- The resource manager that may be used to locate resources.licenseProvider
- The license provider to check if using the match engine is allowed.- Throws:
InitializationException
- This exception is thrown when the match engine could not be initialized due to invalid data provided by the data source.
-
-
Method Details
-
getCaseBase
Description copied from interface:IMatchEngine
This method returns the casebase for the specified entity type name.- Specified by:
getCaseBase
in interfaceIMatchEngine
- Parameters:
entityName
- The name of the entity for which the casebase is requested.- Returns:
- The casebase of the specified entity type.
-
getMutableCaseBase
Description copied from interface:IMatchEngine
This method returns the mutable casebase for the specified entity type name. In a mutable casebase cases can be inserted, updated, and deleted while the application is running. After all changes in the case data are registered, the methodIMatchEngine.applyCaseBaseUpdates()
must be called to apply the changes to the casebases. Changes in the case data are applied to the casebases after all running match and detailMatch operations have finished.- Specified by:
getMutableCaseBase
in interfaceIMatchEngine
- Parameters:
entityName
- The name of the entity for which the casebase is requested.- Returns:
- The casebase of the specified entity type.
-
getMatchFunction
Description copied from interface:IMatchEngine
This method returns the match function as defined in studio.- Specified by:
getMatchFunction
in interfaceIMatchEngine
- Parameters:
functionName
- The name of the match function as defined in studio.- Returns:
- A match function for the specified name.
-
match
Description copied from interface:IMatchEngine
This method matches the request against the internal casebase and returns the match result containing the matching cases.- Specified by:
match
in interfaceIMatchEngine
- Parameters:
request
- The request that should be matched.- Returns:
- Object containing the result of the match (never null).
-
detailMatch
Description copied from interface:IMatchEngine
This method may be used to match the request against a specific case, in order to get a detailed matched result explaining how each value of the request matches against the values of the case.- Specified by:
detailMatch
in interfaceIMatchEngine
- Parameters:
request
- The request containing the values that should be matched against the case.caseId
- The ID of the case that should be used to match the request against.- Returns:
- Object containing detailed information about the match scores of the values that were matched from the request.
-
getMatchFunctionList
-
hasCaseBase
-
applyCaseBaseUpdates
public void applyCaseBaseUpdates()Description copied from interface:IMatchEngine
This method must be called to apply any modifications in the case data to the match engine. Changes in the case data are registered via theIMutableCaseBase
interface. After all changes are registered, this method must be called to apply the changes to the casebases. Changes in the case data are applied to the casebases after all running match and detailMatch operations have finished.- Specified by:
applyCaseBaseUpdates
in interfaceIMatchEngine
-