Search in sources :

Example 1 with FunctionGenerator

use of org.drools.modelcompiler.builder.generator.FunctionGenerator in project drools by kiegroup.

the class PackageModel method initPackageModel.

public static void initPackageModel(KnowledgeBuilderImpl kbuilder, InternalKnowledgePackage pkg, TypeResolver typeResolver, PackageDescr packageDescr, PackageModel packageModel) {
    packageModel.addImports(pkg.getImports().keySet());
    packageModel.addStaticImports(pkg.getStaticImports());
    packageModel.addEntryPoints(packageDescr.getEntryPointDeclarations());
    packageModel.addGlobals(pkg);
    packageModel.setAccumulateFunctions(pkg.getAccumulateFunctions());
    packageModel.setInternalKnowledgePackage(pkg);
    new WindowReferenceGenerator(packageModel, typeResolver).addWindowReferences(kbuilder, packageDescr.getWindowDeclarations());
    packageModel.addAllFunctions(packageDescr.getFunctions().stream().map(FunctionGenerator::toFunction).collect(toList()));
}
Also used : FunctionGenerator(org.drools.modelcompiler.builder.generator.FunctionGenerator) WindowReferenceGenerator(org.drools.modelcompiler.builder.generator.WindowReferenceGenerator)

Aggregations

FunctionGenerator (org.drools.modelcompiler.builder.generator.FunctionGenerator)1 WindowReferenceGenerator (org.drools.modelcompiler.builder.generator.WindowReferenceGenerator)1