Search in sources :

Example 1 with JavaRuleClassBuilder

use of org.drools.compiler.rule.builder.JavaRuleClassBuilder in project drools by kiegroup.

the class LegacyAccumulate method createAllAccumulateClass.

private GeneratedClassWithPackage createAllAccumulateClass(Set<String> imports, String packageName) {
    final String allAccumulatesClass = new JavaRuleClassBuilder().buildRule(ruleBuildContext);
    final CompilationUnit parsedAccumulateClass = parse(allAccumulatesClass);
    return new GeneratedClassWithPackage((ClassOrInterfaceDeclaration) parsedAccumulateClass.getType(0), packageName, imports, Collections.emptyList());
}
Also used : CompilationUnit(com.github.javaparser.ast.CompilationUnit) GeneratedClassWithPackage(org.drools.modelcompiler.builder.GeneratedClassWithPackage) JavaRuleClassBuilder(org.drools.compiler.rule.builder.JavaRuleClassBuilder)

Aggregations

CompilationUnit (com.github.javaparser.ast.CompilationUnit)1 JavaRuleClassBuilder (org.drools.compiler.rule.builder.JavaRuleClassBuilder)1 GeneratedClassWithPackage (org.drools.modelcompiler.builder.GeneratedClassWithPackage)1