Package com.aquima.interactions.rule
Interface InferenceContext
- All Superinterfaces:
IEventChannel
,IProfile
,IProfileLifecycle
,Serializable
- All Known Subinterfaces:
IComposerContext
- All Known Implementing Classes:
ComposerContext
,ConcurrentInferenceContext
,DefaultContext
,DependencyProfile
,DependentValueContext
,InferenceContextDelegate
,InstanceContext
,InstanceStackContext
,PortalProfile
,ReadonlyInferenceContext
,TmsProfile
,TxInferenceContext
,UsedValuesInferenceContext
The inference context interface is a specialization of the profile interface, and is used during rule evaluation to
retrieve the current values. The main addition to the normal profile interface that this interface defines, is the
ability to request the active instance for a specified entity type. During the evaluation of a rule the rule engine
might active instances when for instance relation attributes are used. The rules themselves however always operate on
the active instance, and do not need to concern about which instance should be activated.
This interface may also be used to evaluate a rule using a different context. The composer or flow engine might for instance extend this interface to add additional active instances, that were determined during the flow or for instance by an inline container.
- Since:
- 5.0
- Author:
- O. Kerpershoek
-
Method Summary
Modifier and TypeMethodDescriptiongetActiveInstance
(String entityName) This method returns the active instance for the specified type.getInferenceDetails
(ValueReference attributeReference) This method may be used to request detailed inference information for a specific attribute.Methods inherited from interface com.aquima.interactions.foundation.events.IEventChannel
addEventListener, getSupportedEvents, removeEventListener
Methods inherited from interface com.aquima.interactions.profile.IProfile
commitTransaction, createInstance, createInstance, deleteInstance, getAllInstancesForEntity, getEntityDefinition, getInstance, getInstanceById, getInstanceByName, getSingletonInstance, getState, restore, rollbackTransaction, startTransaction
Methods inherited from interface com.aquima.interactions.profile.IProfileLifecycle
activate, passivate
-
Method Details
-
getActiveInstance
This method returns the active instance for the specified type. When no active instance can be found for the specified type, the type is assumed to be a singleton instance. When this method is invoked for a non singleton type without any active instance, the call to the getSingletonInstance will fail due to a CreateInstanceException.- Parameters:
entityName
- The entity type for which the active instance is requested.- Returns:
- The instance that is active for the specified type.
- Throws:
UnknownInstanceException
- This exception type is raised when no active instance could be found for the specified type.UnknownEntityException
- This exception type is raised when the entity type is unknown.CreateInstanceException
- This type of exception may be raised when a singleton instance could not be created for the specified type.
-
getInferenceDetails
This method may be used to request detailed inference information for a specific attribute. The details object contains information like which rule inferenced the value, and what other values were used by the rule engine to determine the current result.- Parameters:
attributeReference
- The reference to the attribute whose inference information is requested.- Returns:
- Object containing detailed information about the value related to the inference process.
- Throws:
AppException
- This exception is thrown when the inference details could not be retrieved.
-