diff --git a/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/FunctionActivatorArtifact.java b/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/FunctionActivatorArtifact.java index e9ac1dfa231..8080dbb41f3 100644 --- a/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/FunctionActivatorArtifact.java +++ b/legend-engine-xts-functionActivator/legend-engine-xt-functionActivator-protocol/src/main/java/org/finos/legend/engine/protocol/functionActivator/deployment/FunctionActivatorArtifact.java @@ -29,7 +29,7 @@ public class FunctionActivatorArtifact public String getVersionInfo(AlloySDLC sdlc) { - if (this.version != null) + if (sdlc.version != null) { return sdlc.groupId + ":" + sdlc.artifactId + ":" + sdlc.version; } diff --git a/legend-engine-xts-hostedService/legend-engine-xt-hostedService-generation/src/main/java/org/finos/legend/engine/language/hostedService/generation/HostedServiceArtifactGenerator.java b/legend-engine-xts-hostedService/legend-engine-xt-hostedService-generation/src/main/java/org/finos/legend/engine/language/hostedService/generation/HostedServiceArtifactGenerator.java index a630e93fc3f..b9320578f9d 100644 --- a/legend-engine-xts-hostedService/legend-engine-xt-hostedService-generation/src/main/java/org/finos/legend/engine/language/hostedService/generation/HostedServiceArtifactGenerator.java +++ b/legend-engine-xts-hostedService/legend-engine-xt-hostedService-generation/src/main/java/org/finos/legend/engine/language/hostedService/generation/HostedServiceArtifactGenerator.java @@ -18,8 +18,12 @@ import org.eclipse.collections.api.block.function.Function; import org.eclipse.collections.api.factory.Lists; import org.eclipse.collections.api.factory.Maps; +import org.eclipse.collections.api.list.ListIterable; +import org.eclipse.collections.api.list.MutableList; import org.finos.legend.engine.language.hostedService.generation.control.HostedServiceOwnerValidationService; import org.finos.legend.engine.language.hostedService.generation.control.HostedServiceOwnerValidator; +import org.finos.legend.engine.plan.generation.extension.PlanGeneratorExtension; +import org.finos.legend.engine.plan.generation.transformers.PlanTransformer; import org.finos.legend.engine.protocol.hostedService.deployment.model.GenerationInfoData; import org.finos.legend.engine.language.pure.compiler.toPureGraph.PureModel; import org.finos.legend.engine.plan.generation.PlanGenerator; @@ -41,11 +45,14 @@ import org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.function.ConcreteFunctionDefinition; import java.util.Map; +import java.util.ServiceLoader; import static org.finos.legend.pure.generated.platform_pure_basics_meta_elementToPath.Root_meta_pure_functions_meta_elementToPath_PackageableElement_1__String_1_; public class HostedServiceArtifactGenerator { + static final MutableList generatorExtensions = Lists.mutable.withAll(ServiceLoader.load(PlanGeneratorExtension.class)); + public static GenerationInfoData renderArtifact(PureModel pureModel, Root_meta_external_function_activator_hostedService_HostedService activator, PureModelContext inputModel, String clientVersion, Function> routerExtensions) { ExecutionPlan plan = generatePlan(pureModel, activator, inputModel, clientVersion, routerExtensions); @@ -55,6 +62,7 @@ public static GenerationInfoData renderArtifact(PureModel pureModel, Root_meta_e public static ExecutionPlan generatePlan(PureModel pureModel, Root_meta_external_function_activator_hostedService_HostedService activator, PureModelContext inputModel, String clientVersion,Function> routerExtensions) { + ListIterable transformers = generatorExtensions.flatCollect(PlanGeneratorExtension::getExtraPlanTransformers); if (core_hostedservice_generation_generation.Root_meta_external_function_activator_hostedService_generation_isMultiEenvironmentService_HostedService_1__Boolean_1_(activator, pureModel.getExecutionSupport())) { Map plans = Maps.mutable.empty(); @@ -62,7 +70,7 @@ public static ExecutionPlan generatePlan(PureModel pureModel, Root_meta_external core_hostedservice_generation_generation.Root_meta_external_function_activator_hostedService_generation_rebuildServiceUsingSingleExecutionParams_HostedService_1__Pair_MANY_(activator, pureModel.getExecutionSupport()).forEach(p -> { ExecutionPlan plan = PlanGenerator.generateExecutionPlan((ConcreteFunctionDefinition) p._second()._function(), null, null, null, pureModel, - clientVersion, PlanPlatform.JAVA, null, routerExtensions.apply(pureModel), LegendPlanTransformers.transformers); + clientVersion, PlanPlatform.JAVA, null, routerExtensions.apply(pureModel), transformers); plans.put(p._first(), (SingleExecutionPlan) plan); } @@ -72,7 +80,7 @@ public static ExecutionPlan generatePlan(PureModel pureModel, Root_meta_external else { return PlanGenerator.generateExecutionPlan((ConcreteFunctionDefinition)activator._function(), null, null, null, pureModel, - clientVersion, PlanPlatform.JAVA, null, routerExtensions.apply(pureModel), LegendPlanTransformers.transformers); + clientVersion, PlanPlatform.JAVA, null, routerExtensions.apply(pureModel), transformers); } }