Search in sources :

Example 1 with PackageableElementSecondPassBuilder

use of org.finos.legend.engine.language.pure.compiler.toPureGraph.PackageableElementSecondPassBuilder in project legend-engine by finos.

the class ServiceModeling method compileService.

public Root_meta_legend_service_metamodel_Service compileService(Service service, CompileContext compileContext) {
    // If we're recompiling an existing service remove the original first
    Package pkg = compileContext.pureModel.getOrCreatePackage(service._package);
    org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.PackageableElement existing = pkg._children().detect(c -> c._name().equals(service.name));
    if (existing != null) {
        pkg._childrenRemove(existing);
    }
    Root_meta_legend_service_metamodel_Service compiledService = (Root_meta_legend_service_metamodel_Service) service.accept(new PackageableElementFirstPassBuilder(compileContext));
    service.accept(new PackageableElementSecondPassBuilder(compileContext));
    return compiledService;
}
Also used : Package(org.finos.legend.pure.m3.coreinstance.Package) Root_meta_legend_service_metamodel_Service(org.finos.legend.pure.generated.Root_meta_legend_service_metamodel_Service) PackageableElementSecondPassBuilder(org.finos.legend.engine.language.pure.compiler.toPureGraph.PackageableElementSecondPassBuilder) PackageableElementFirstPassBuilder(org.finos.legend.engine.language.pure.compiler.toPureGraph.PackageableElementFirstPassBuilder)

Aggregations

PackageableElementFirstPassBuilder (org.finos.legend.engine.language.pure.compiler.toPureGraph.PackageableElementFirstPassBuilder)1 PackageableElementSecondPassBuilder (org.finos.legend.engine.language.pure.compiler.toPureGraph.PackageableElementSecondPassBuilder)1 Root_meta_legend_service_metamodel_Service (org.finos.legend.pure.generated.Root_meta_legend_service_metamodel_Service)1 Package (org.finos.legend.pure.m3.coreinstance.Package)1