Package ru.ewc.decita
Class DecisionTable
java.lang.Object
ru.ewc.decita.DecisionTable
- All Implemented Interfaces:
Locator
I am a collection of
Rules used to compute any kind of decision. My main responsibility
is to orchestrate the computation and choose the only satisfied Rule.- Since:
- 0.1
-
Field Summary
Fields inherited from interface ru.ewc.decita.Locator
CONSTANT_VALUES -
Constructor Summary
ConstructorsConstructorDescriptionDecisionTable(Iterable<Rule> rules) Ctor.DecisionTable(Iterable<Rule> rules, Rule elserule) Ctor. -
Method Summary
Modifier and TypeMethodDescriptionfragmentBy(String fragment, ComputationContext context) Determines the system's state - the value of a single property, described by its name.outcome(ComputationContext context) Computes this table's outcomes by checking all of itsRules.
-
Constructor Details
-
Method Details
-
fragmentBy
Description copied from interface:LocatorDetermines the system's state - the value of a single property, described by its name.- Specified by:
fragmentByin interfaceLocator- Parameters:
fragment- The String identifier of the required property.context- TheComputationContextto use in property retrieval.- Returns:
- The value of the requested property as a
String. - Throws:
DecitaException- When the requestedCoordinatecannot be found.
-
outcome
Description copied from interface:LocatorComputes this table's outcomes by checking all of itsRules.- Specified by:
outcomein interfaceLocator- Parameters:
context- The specificComputationContextto make a decision in.- Returns:
- The simple dictionary of the table's outcomes.
- Throws:
DecitaException- If any of theRules cannot be checked.
-