Search in sources :

Example 1 with ANCConfiguration

use of org.drools.ancompiler.ANCConfiguration in project drools by kiegroup.

the class DMNAlphaNetworkEvaluatorCompiler method createAlphaNetworkCompiler.

private ObjectTypeNodeCompiler createAlphaNetworkCompiler(ObjectTypeNode firstObjectTypeNodeOfRete) {
    ANCConfiguration ancConfiguration = new ANCConfiguration();
    ancConfiguration.setDisableContextEntry(true);
    ancConfiguration.setPrettyPrint(true);
    ancConfiguration.setEnableModifyObject(false);
    ObjectTypeNodeCompiler objectTypeNodeCompiler = new ObjectTypeNodeCompiler(ancConfiguration, firstObjectTypeNodeOfRete, true);
    VariableDeclarator variableDeclarator = new VariableDeclarator(StaticJavaParser.parseType(AlphaNetworkEvaluationContext.class.getCanonicalName()), "ctx");
    objectTypeNodeCompiler.addAdditionalFields(new FieldDeclaration(NodeList.nodeList(), NodeList.nodeList(variableDeclarator)));
    return objectTypeNodeCompiler;
}
Also used : ANCConfiguration(org.drools.ancompiler.ANCConfiguration) ObjectTypeNodeCompiler(org.drools.ancompiler.ObjectTypeNodeCompiler) FieldDeclaration(com.github.javaparser.ast.body.FieldDeclaration) VariableDeclarator(com.github.javaparser.ast.body.VariableDeclarator)

Aggregations

FieldDeclaration (com.github.javaparser.ast.body.FieldDeclaration)1 VariableDeclarator (com.github.javaparser.ast.body.VariableDeclarator)1 ANCConfiguration (org.drools.ancompiler.ANCConfiguration)1 ObjectTypeNodeCompiler (org.drools.ancompiler.ObjectTypeNodeCompiler)1