com.hammurapi.reasoning.impl
Class RuleSetToFlowCompiler
java.lang.Object
com.hammurapi.reasoning.impl.RuleSetToFlowCompiler
- All Implemented Interfaces:
- Constants
public class RuleSetToFlowCompiler
- extends Object
- implements Constants
Compiles (transforms) rule set to flow definition.
- Author:
- Pavel Vlasov
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RuleSetToFlowCompiler
public RuleSetToFlowCompiler()
compile
public Flow compile(RuleSet source,
FactoryConfig factoryConfig)
throws ConfigurationException
- Compiles rule set to flow.
- Parameters:
ruleSet - Rule set. The rule set gets modified during compilation and shall be
discarded after compilation.classLoader - Classloader to load rule classes for introspection. If null, then
this class' classloader is used.
- Returns:
- Flow definition.
- Throws:
ConfigurationException
createInferenceMethodNode
protected Node createInferenceMethodNode(RuleSet ruleSet,
Rule rule,
Method method,
Flow owner)
- Creates inference method node.
Subclasses can override this method to provide custom
node implementations and additional configuration.
- Parameters:
method - rule - ruleSet - ret -
- Returns:
getInferAnnotation
protected Infer getInferAnnotation(Method method)
- Extracts inference information from the method.
This implementation takes it from Infer annotation.
Subclasses can do it in a different way.
- Parameters:
method -
- Returns:
createNode
protected Node createNode(Flow flow,
Class<?> type)
main
public static void main(String[] args)
throws Exception
- Parameters:
args -
- Throws:
Exception
printDiagnostic
protected static void printDiagnostic(org.eclipse.emf.common.util.Diagnostic diagnostic,
String indent)