From d253841928ac8998da0be1032107255488c9bd19 Mon Sep 17 00:00:00 2001 From: Jake Kim <60619826+jake-kim1@users.noreply.github.com> Date: Thu, 28 Nov 2024 12:00:55 -0500 Subject: [PATCH] Create TDSRelationAccessor for PCT (#905) * Create TDSRelationAccessor for PCT * Use fully qualified path for RelationElementAccessor * Update SPR id * Add constraint for type checking in TDSRelationAccessor * Update tds.pure * Update pom.xml --- .../main/resources/platform_dsl_tds/tds.pure | 19 ++++++++++++++++++- .../pom.xml | 4 ++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/legend-pure-dsl/legend-pure-dsl-tds/legend-pure-m2-dsl-tds-pure/src/main/resources/platform_dsl_tds/tds.pure b/legend-pure-dsl/legend-pure-dsl-tds/legend-pure-m2-dsl-tds-pure/src/main/resources/platform_dsl_tds/tds.pure index be1e257bba..0fdd2f9a2a 100644 --- a/legend-pure-dsl/legend-pure-dsl-tds/legend-pure-m2-dsl-tds-pure/src/main/resources/platform_dsl_tds/tds.pure +++ b/legend-pure-dsl/legend-pure-dsl-tds/legend-pure-m2-dsl-tds-pure/src/main/resources/platform_dsl_tds/tds.pure @@ -19,4 +19,21 @@ Class meta::pure::metamodel::relation::TDS extends meta::pure::metamodel::rel csv : String[1]; } -native function meta::pure::metamodel::relation::stringToTDS(s:String[1]):meta::pure::metamodel::relation::TDS[1]; \ No newline at end of file +Class meta::pure::metamodel::relation::TDSRelationAccessor extends meta::pure::metamodel::relation::RelationElementAccessor +[ + sourceElementExists + ( + ~function: $this.sourceElement->isNotEmpty() && $this.sourceElement->instanceOf(meta::pure::metamodel::relation::TDS) + ~enforcementLevel: Error + ~message: 'Source element needs to exist and to be type of TDS' + ) +] +{ +} + +function meta::pure::metamodel::relation::newTDSRelationAccessor(tds:TDS[1]):TDSRelationAccessor[1] +{ + ^TDSRelationAccessor(sourceElement = $tds); +} + +native function meta::pure::metamodel::relation::stringToTDS(s:String[1]):meta::pure::metamodel::relation::TDS[1]; diff --git a/legend-pure-dsl/legend-pure-dsl-tds/legend-pure-runtime-java-extension-compiled-dsl-tds/pom.xml b/legend-pure-dsl/legend-pure-dsl-tds/legend-pure-runtime-java-extension-compiled-dsl-tds/pom.xml index 90ace3afa3..42cdd34fcc 100644 --- a/legend-pure-dsl/legend-pure-dsl-tds/legend-pure-runtime-java-extension-compiled-dsl-tds/pom.xml +++ b/legend-pure-dsl/legend-pure-dsl-tds/legend-pure-runtime-java-extension-compiled-dsl-tds/pom.xml @@ -101,6 +101,10 @@ legend-pure-runtime-java-engine-compiled + + org.eclipse.collections + eclipse-collections + org.eclipse.collections eclipse-collections-api