Class RuleGraph
java.lang.Object
com.aquima.interactions.rule.graph.RuleGraph
- All Implemented Interfaces:
IRuleGraph
The rule graph class contains the node structure for all the attributes with the business rules that are applicable.
- Since:
- 5.0
- Author:
- O. Kerpershoek
-
Constructor Summary
ConstructorsConstructorDescriptionRuleGraph
(IProject project, IMetaModel metamodel, IParserFactory parserFactory, IRuleFactory factory, IValidatorFactory validators, IConnectionManager connectionManager, IRuleEngineDS datasource) Constructs the rule graph with the required parameters. -
Method Summary
Modifier and TypeMethodDescriptionThis method returns an array containing all the entity nodes present in the rule graph.getAttributeNode
(String entity, String attribute) This method returns the IAttributeNodeof the dependency graph for the given attribute.getEntityNode
(String entityName) This method returns the IEntityNode of the dependency graph for the given entity name.getRuleGroup
(String name) This method returns the rule group definition for the specified name.protected boolean
protected boolean
This method returns a boolean that indicates if a scope error should be ignored by the R4 parser.protected boolean
This method returns a boolean indicating if a R4 compatible parser is used.
-
Constructor Details
-
RuleGraph
public RuleGraph(IProject project, IMetaModel metamodel, IParserFactory parserFactory, IRuleFactory factory, IValidatorFactory validators, IConnectionManager connectionManager, IRuleEngineDS datasource) Constructs the rule graph with the required parameters.- Parameters:
project
- Project containing various global definitions.metamodel
- The metamodel for which the rule graph is constructed.parserFactory
- Factory that should be used to parse expressions.factory
- Factory that should be used to create custom rules.validators
- Factory that can provide validator implementations.connectionManager
- the connection managerdatasource
- Data-source that provides all the rule information needed to construct the graph.- Throws:
InitializationException
- This exception is thrown when the graph could not be constructed due to a fatal initialization error.
-
-
Method Details
-
isR4Parser
protected boolean isR4Parser()This method returns a boolean indicating if a R4 compatible parser is used. The R4 compatible flag will influence the way decision table conditions are 'fixed'.- Returns:
- a boolean indicating if a R4 compatible parser is used.
-
isR4IgnoreScope
protected boolean isR4IgnoreScope()This method returns a boolean that indicates if a scope error should be ignored by the R4 parser. Scope errors are fatal when the Aquima runtime is used to run the application, but can sometimes be ignored for applications that only use the validation.- Returns:
- a boolean that indicates if a scope error should be ignored by the R4 parser.
-
getRuleGroup
Description copied from interface:IRuleGraph
This method returns the rule group definition for the specified name.- Specified by:
getRuleGroup
in interfaceIRuleGraph
- Parameters:
name
- The name of the requested rule group.- Returns:
- The rule group definition for the specified name.
-
getEntityNode
Description copied from interface:IRuleGraph
This method returns the IEntityNode of the dependency graph for the given entity name.- Specified by:
getEntityNode
in interfaceIRuleGraph
- Parameters:
entityName
- The name of the entity.- Returns:
- IEntityNode The entity node of the dependency graph for the given entity name.
-
getAttributeNode
Description copied from interface:IRuleGraph
This method returns the IAttributeNodeof the dependency graph for the given attribute. When the attribute is not used by a business rule, this method may return null.- Specified by:
getAttributeNode
in interfaceIRuleGraph
- Parameters:
entity
- The name of the entity that contains the attribute (this does not need to be the name of the entity in which the attribute is defined, but may also be the entity that contains the attribute by inheritance.attribute
- The name of the attribute.- Returns:
- IAttributeNode The attribute node of the dependency graph for the given attribute name, or null when the attribute has no dependencies.
-
getAllEntityNodes
Description copied from interface:IRuleGraph
This method returns an array containing all the entity nodes present in the rule graph.- Specified by:
getAllEntityNodes
in interfaceIRuleGraph
- Returns:
- Array containing all the entity nodes of the rule graph.
-
isDowncastAllowed
protected boolean isDowncastAllowed()
-