From c8012a6e5560374716c9206c2a8f6ef156638154 Mon Sep 17 00:00:00 2001 From: Pierre De Belen Date: Thu, 7 Nov 2024 16:30:15 -0500 Subject: [PATCH] Update Protocol Pure classes --- .../protocol/vX_X_X/models/metamodel.pure | 28 ++++++++++--- .../vX_X_X/transfers/executionPlan.pure | 2 +- .../protocol/vX_X_X/transfers/metamodel.pure | 6 +-- .../vX_X_X/transfers/valueSpecification.pure | 39 +++++++++++-------- .../specification_generator.pure | 12 +++--- .../autogeneration/relationalToPure.pure | 8 ++-- 6 files changed, 58 insertions(+), 37 deletions(-) diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/models/metamodel.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/models/metamodel.pure index b015b00a3eb..6e97fa4a4bb 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/models/metamodel.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/models/metamodel.pure @@ -206,7 +206,7 @@ Class meta::protocols::pure::vX_X_X::metamodel::domain::Property extends meta::p defaultValue : meta::protocols::pure::vX_X_X::metamodel::domain::DefaultValue[0..1]; name : String[1]; multiplicity : meta::protocols::pure::vX_X_X::metamodel::domain::Multiplicity[1]; - type : String[1]; + genericType : meta::protocols::pure::vX_X_X::metamodel::type::GenericType[1]; propertyTypeSourceInformation: SourceInformation[0..1]; } @@ -214,7 +214,7 @@ Class meta::protocols::pure::vX_X_X::metamodel::domain::QualifiedProperty extend { name : String[1]; parameters : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable[*]; - returnType : String[1]; + returnGenericType : meta::protocols::pure::vX_X_X::metamodel::type::GenericType[1]; returnMultiplicity : meta::protocols::pure::vX_X_X::metamodel::domain::Multiplicity[1]; body : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::ValueSpecification[*]; } @@ -254,7 +254,23 @@ Class meta::protocols::pure::vX_X_X::metamodel::domain::Unit conversionFunction : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::Lambda[0..1]; } +Class meta::protocols::pure::vX_X_X::metamodel::type::Type +{ + _type : String[1]; +} +Class meta::protocols::pure::vX_X_X::metamodel::type::PackageableType extends meta::protocols::pure::vX_X_X::metamodel::type::Type, meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::PackageableElementPtr +{ + +} + +Class meta::protocols::pure::vX_X_X::metamodel::type::GenericType +{ + rawType : meta::protocols::pure::vX_X_X::metamodel::type::Type[1]; + typeArguments : meta::protocols::pure::vX_X_X::metamodel::type::GenericType[*]; + multiplicityArguments : meta::protocols::pure::vX_X_X::metamodel::domain::Multiplicity[*]; + typeVariableValues : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::ValueSpecification[*]; +} Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::ValueSpecification { @@ -268,7 +284,7 @@ Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable ext supportsStream : Boolean[0..1]; // To Remove multiplicity : meta::protocols::pure::vX_X_X::metamodel::domain::Multiplicity[0..1]; - class : String[0..1]; + genericType : meta::protocols::pure::vX_X_X::metamodel::type::GenericType[0..1]; } Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::application::FunctionApplication extends meta::protocols::pure::vX_X_X::metamodel::valueSpecification::ValueSpecification @@ -310,9 +326,9 @@ Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::KeyExpr expression: meta::protocols::pure::vX_X_X::metamodel::valueSpecification::ValueSpecification[1]; } -Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance extends meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::PackageableElementPtr +Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance extends meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::RawValue { - + genericType : meta::protocols::pure::vX_X_X::metamodel::type::GenericType[1]; } Class meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::EnumValue extends meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::RawValue @@ -842,7 +858,7 @@ Class meta::protocols::pure::vX_X_X::metamodel::domain::Function extends meta::p { preConstraints:meta::protocols::pure::vX_X_X::metamodel::domain::Constraint[*]; postConstraints:meta::protocols::pure::vX_X_X::metamodel::domain::Constraint[*]; - returnType:String[1]; + returnGenericType:meta::protocols::pure::vX_X_X::metamodel::type::GenericType[1]; returnMultiplicity:meta::protocols::pure::vX_X_X::metamodel::domain::Multiplicity[1]; parameters : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable[*]; body : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::ValueSpecification[*]; diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/executionPlan.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/executionPlan.pure index 6ae68ebd2ba..dee7c74562d 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/executionPlan.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/executionPlan.pure @@ -103,7 +103,7 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::execution ^meta::protocols::pure::vX_X_X::metamodel::executionPlan::FunctionParametersValidationNode( _type = 'function-parameters-validation', resultType = $exp.resultType->transformResultType($extensions), - functionParameters = $exp.functionParameters->map(p | ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable(_type='var', name=$p.name, supportsStream=$p.supportsStream, class=$p.type->elementToPath(), multiplicity=$p.multiplicity->isEmpty()->if(| [],| $p.multiplicity->toOne()->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()))), + functionParameters = $exp.functionParameters->map(p | ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable(_type='var', name=$p.name, supportsStream=$p.supportsStream, genericType=^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath=$p.type->elementToPath())), multiplicity=$p.multiplicity->isEmpty()->if(| [],| $p.multiplicity->toOne()->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()))), parameterValidationContext = $exp.parameterValidationContext->map(p | $p->match([ e:meta::pure::executionPlan::EnumValidationContext[1] | ^meta::protocols::pure::vX_X_X::metamodel::executionPlan::EnumValidationContext(varName = $e.varName, validEnumValues = $e.validEnumValues, _type = 'enumValidationContext') ])) diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/metamodel.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/metamodel.pure index c2338de8574..5c199b5dd8f 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/metamodel.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/metamodel.pure @@ -145,7 +145,7 @@ function <> meta::protocols::pure::vX_X_X::transformation::fromP defaultValue = if($property.defaultValue->isEmpty(),|[],|$property.defaultValue->toOne()->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformDefaultValue($extensions)->toOne()), name = $property.name->toOne(), multiplicity = $property.multiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()->toOne(), - type = $property.genericType.rawType->toOne()->elementToPath(), + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath=$property.genericType.rawType->toOne()->elementToPath())), stereotypes = $property.stereotypes->map(s|$s->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformStereotype()), taggedValues = $property.taggedValues->map(t|$t->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformTaggedValue()) ) @@ -164,7 +164,7 @@ function <> meta::protocols::pure::vX_X_X::transformation::fromP ( name = $qualifiedProperty.name->toOne(), parameters = $fType.parameters->tail()->map(p|$p->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::valueSpecification::transformValueSpecification([], newMap([]->cast(@Pair>)), true, $extensions)->cast(@meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable)), - returnType = $fType.returnType.rawType->toOne()->elementToPath(), + returnGenericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath=$fType.returnType.rawType->toOne()->elementToPath())), returnMultiplicity = $fType.returnMultiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()->toOne(), body = $qualifiedProperty->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::valueSpecification::transformFunctionBody($useAppliedFunction, $extensions), stereotypes = $qualifiedProperty.stereotypes->map(s|$s->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformStereotype()), @@ -235,7 +235,7 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::transform parameters = $f->functionType().parameters->map(p | $p->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::valueSpecification::transformValueSpecification([], ^Map>(), true, true, $extensions)->cast(@meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable) ), - returnType = $f->functionReturnType().rawType->toOne()->elementToPath(), + returnGenericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath=$f->functionReturnType().rawType->toOne()->elementToPath())), returnMultiplicity = $f->functionReturnMultiplicity()->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()->toOne(), preConstraints = $f.preConstraints->map(c |$c->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformConstraint($extensions)), postConstraints = $f.postConstraints->map(c |$c->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformConstraint($extensions)), diff --git a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/valueSpecification.pure b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/valueSpecification.pure index 68891641471..16cd3343e5d 100644 --- a/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/valueSpecification.pure +++ b/legend-engine-core/legend-engine-core-pure/legend-engine-pure-code-compiled-core/src/main/resources/core/pure/protocol/vX_X_X/transfers/valueSpecification.pure @@ -210,10 +210,15 @@ function <> meta::protocols::pure::vX_X_X::transformation::fromP ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance ( _type = 'genericTypeInstance', - fullPath = $v.genericType.rawType->toOne()->match([ - d:DataType[1]|$d->makeString(), - c:Class[1]|$c->elementToPath() - ]) + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType( + rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType( + _type = 'packageableType', + fullPath = $v.genericType.rawType->toOne()->match([ + d:DataType[1]|$d->makeString(), + c:Class[1]|$c->elementToPath() + ]) + ) + ) ) } @@ -228,7 +233,7 @@ function <> meta::protocols::pure::vX_X_X::transformation::fromP _type = 'var', multiplicity = $v.multiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity(), name = $v.name, - class = $v.genericType.rawType->toOne()->elementToPath() + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath=$v.genericType.rawType->toOne()->elementToPath())) ); ,|^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable ( @@ -241,7 +246,7 @@ function <> meta::protocols::pure::vX_X_X::transformation::fromP function <> meta::protocols::pure::vX_X_X::transformation::fromPureGraph::valueSpecification::transformHackedUnit(v:ValueSpecification[1]):meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance[1] { - ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance(_type='genericTypeInstance', fullPath=$v.genericType.rawType->toOne()->elementToPath()); + ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance(_type='genericTypeInstance', genericType=^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath=$v.genericType.rawType->toOne()->elementToPath()))); } function <> meta::protocols::pure::vX_X_X::transformation::fromPureGraph::valueSpecification::transformUnitInstance(v:ValueSpecification[1]):meta::protocols::pure::vX_X_X::metamodel::valueSpecification::UnitInstance[1] @@ -773,9 +778,9 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGra function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::classElementsToPure(as:Any[*], separator:String[1]):String[1]{ $as->map(a|$a->match([ c:meta::protocols::pure::vX_X_X::metamodel::domain::Class[1]| let nonAnySuperTypes = $c.superTypes->filter(s|$s != 'meta::pure::metamodel::type::Any'); '\nClass '+ if($c.stereotypes->isNotEmpty(),|'\t<<'+$c.stereotypes->classElementsToPure(',') + '>>\n',|'') + if($c.taggedValues->isNotEmpty(),|'\t{'+$c.taggedValues->classElementsToPure(',')+'}\n',|'') + if($c.package->isEmpty(),|$c.name,|$c.package->toOne()+'::'+$c.name) + if($nonAnySuperTypes->isNotEmpty(),| ' extends '+$nonAnySuperTypes->makeString(','),|'') +'\n{\n' + $c.properties->classElementsToPure('\n') + '\n' + $c.qualifiedProperties->classElementsToPure('\n')+'\n}\n';, - p:meta::protocols::pure::vX_X_X::metamodel::domain::Property[1]| if($p.stereotypes->isNotEmpty(),|'\t<<'+$p.stereotypes->classElementsToPure(',') + '>>\n',|'') + if($p.taggedValues->isNotEmpty(),|'\t{'+$p.taggedValues->classElementsToPure(',')+'}\n',|'') + '\t'+$p.name+':'+$p.type+'['+$p.multiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::mapToString() +'];', - q:meta::protocols::pure::vX_X_X::metamodel::domain::QualifiedProperty[1]| '\t'+$q.name+'('+$q.parameters->tail()->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::classElementsToPure(',')+'){'+$q.body->toPure()->replace('\n','')+'}:'+$q.returnType+'['+$q.returnMultiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::mapToString() +'];', - v:meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable[1]|$v.name + ':' + $v.class->toOne() +'['+$v.multiplicity->toOne()->mapToString()+']', + p:meta::protocols::pure::vX_X_X::metamodel::domain::Property[1]| if($p.stereotypes->isNotEmpty(),|'\t<<'+$p.stereotypes->classElementsToPure(',') + '>>\n',|'') + if($p.taggedValues->isNotEmpty(),|'\t{'+$p.taggedValues->classElementsToPure(',')+'}\n',|'') + '\t'+$p.name+':'+$p.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath+'['+$p.multiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::mapToString() +'];', + q:meta::protocols::pure::vX_X_X::metamodel::domain::QualifiedProperty[1]| '\t'+$q.name+'('+$q.parameters->tail()->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::classElementsToPure(',')+'){'+$q.body->toPure()->replace('\n','')+'}:'+$q.returnGenericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath+'['+$q.returnMultiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGrammar::mapToString() +'];', + v:meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable[1]|$v.name + ':' + $v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne() +'['+$v.multiplicity->toOne()->mapToString()+']', s:meta::protocols::pure::vX_X_X::metamodel::domain::StereotypePtr[1]|$s.profile+'.'+$s.value, t:meta::protocols::pure::vX_X_X::metamodel::domain::TaggedValue[1]|$t.tag.profile+'.'+$t.tag.value+'=\''+$t.value->replace('\'','\\\'')->replace('\n',' ')+'\'' ]))->makeString($separator) @@ -892,13 +897,13 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGra l : Lambda[1]| let pStr = $l.parameters->map(p|$p->match([ v : Variable[1]| - if ($v.class->isEmpty(), + if ($v.genericType->isEmpty(), |$v.name, - |let cName = if($v.class->in([Float, Any, String, Integer, Boolean, Date, DateTime, StrictDate]->map(x|$x->makeString())), - | $v.class->toOne()->makeString(), - | if($v.class->toOne()->isInMeta(), - |$v.class->toOne()->substring($v.class->toOne()->lastIndexOf('::')+2), - |$v.class->toOne() + |let cName = if($v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->in([Float, Any, String, Integer, Boolean, Date, DateTime, StrictDate]->map(x|$x->makeString())), + | $v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne()->makeString(), + | if($v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne()->isInMeta(), + |$v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne()->substring($v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne()->lastIndexOf('::')+2), + |$v.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne() ); )->toOne(); let m = $v.multiplicity->toOne()->mapToString(); @@ -910,14 +915,14 @@ function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::toPureGra '{%s|%s}'->format([$pStr, $bStr]);, v : Variable[1]|'$' + $v.name, - hackedClass :meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance[1]|'@' + $hackedClass.fullPath, + hackedClass :meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::GenericTypeInstance[1]|'@' + $hackedClass.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath, ci : ClassInstance[1] | $ci.value->match( [ aggValue : TDSAggregateValue[1]| 'agg(\'%s\', %s, %s)'->format([$aggValue.name, $state->toPure($aggValue.mapFn), $state->toPure($aggValue.aggregateFn)]), aggValue : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::AggregateValue[1]| 'agg(%s, %s)'->format([$state->toPure($aggValue.mapFn), $state->toPure($aggValue.aggregateFn)]), sortInfo : TDSSortInformation[1]| '^SortInformation(column = \'%s\', direction = SortDirection.%s)'->format([$sortInfo.column, $sortInfo.direction]), - extendInfo: TDSColumnInformation[1] | '^BasicColumnSpecification<%s>(name = \'%s\', func = %s)'->format([$extendInfo.columnFn->cast(@Lambda).parameters->at(0).class->toOne(), $extendInfo.name, $state->toPure($extendInfo.columnFn)]), + extendInfo: TDSColumnInformation[1] | '^BasicColumnSpecification<%s>(name = \'%s\', func = %s)'->format([$extendInfo.columnFn->cast(@Lambda).parameters->at(0).genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath->toOne(), $extendInfo.name, $state->toPure($extendInfo.columnFn)]), path : Path[1]| '#/%s/%s%s#'->format([$path.startType, $path.path->map(p|$p->match([ppe:PropertyPathElement[1]|$ppe.property]))->joinStrings('.'), if($path.name->isEmpty() || ($path.name->toOne()->length() == 0), |'', |'!' + $path.name->toOne())]);, or : meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::TdsOlapRank[1]| '^TdsOlapRank(func = %s)'->format($state->toPure($or.function)), diff --git a/legend-engine-xts-elasticsearch/legend-engine-xt-elasticsearch-pure-specification-metamodel/src/main/resources/core_elasticsearch_specification_metamodel/specification_generator.pure b/legend-engine-xts-elasticsearch/legend-engine-xt-elasticsearch-pure-specification-metamodel/src/main/resources/core_elasticsearch_specification_metamodel/specification_generator.pure index 5c5ee52c8da..6c45cbc6e11 100644 --- a/legend-engine-xts-elasticsearch/legend-engine-xt-elasticsearch-pure-specification-metamodel/src/main/resources/core_elasticsearch_specification_metamodel/specification_generator.pure +++ b/legend-engine-xts-elasticsearch/legend-engine-xt-elasticsearch-pure-specification-metamodel/src/main/resources/core_elasticsearch_specification_metamodel/specification_generator.pure @@ -66,12 +66,12 @@ function meta::external::store::elasticsearch::specification::metamodel::generat properties = [ ^meta::protocols::pure::vX_X_X::metamodel::domain::Property( name = 'value', - type = 'T', + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath='T')), multiplicity = ZeroOne->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity() ), ^meta::protocols::pure::vX_X_X::metamodel::domain::Property( name = 'expression', - type = 'String', + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath='String')), multiplicity = ZeroOne->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity() ) ], @@ -116,7 +116,7 @@ meta::external::store::elasticsearch::specification::metamodel::addConstraints(c ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::Variable( _type = 'var', name = 'b', - class = 'Boolean', + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath = 'Boolean')), multiplicity = PureOne->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity() ) ] @@ -415,7 +415,7 @@ meta::external::store::elasticsearch::specification::metamodel::createProperty(p {stringVal: String[1] | ^meta::protocols::pure::vX_X_X::metamodel::domain::Property( name = $name, - type = 'String', + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath = 'String')), multiplicity = PureOne->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity(), defaultValue = ^meta::protocols::pure::vX_X_X::metamodel::domain::DefaultValue( value = ^meta::protocols::pure::vX_X_X::metamodel::valueSpecification::raw::CString(_type = 'string', value = $stringVal) @@ -429,7 +429,7 @@ meta::external::store::elasticsearch::specification::metamodel::createProperty(p let multiplicity = $property.type->propertyTypeMultiplicity($property.required, $state); let pureProperty = ^meta::protocols::pure::vX_X_X::metamodel::domain::Property( name = $name, - type = $pureType, + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath = $pureType)), multiplicity = $multiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity() ); } @@ -447,7 +447,7 @@ meta::external::store::elasticsearch::specification::metamodel::createProperty(p ); $state.log(|'Processing property finished: %s (kind: %s)'->format([$property.name, $property.type->type()->elementToPath()])); - if($fullProp.type == 'Nil' || $name == '{dynamic_property}', |[], |$fullProp); + if($fullProp.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath == 'Nil' || $name == '{dynamic_property}', |[], |$fullProp); } function diff --git a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/autogeneration/relationalToPure.pure b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/autogeneration/relationalToPure.pure index d8fb0155f5d..a48bc7742d7 100644 --- a/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/autogeneration/relationalToPure.pure +++ b/legend-engine-xts-relationalStore/legend-engine-xt-relationalStore-generation/legend-engine-xt-relationalStore-pure/legend-engine-xt-relationalStore-core-pure/src/main/resources/core_relational/relational/autogeneration/relationalToPure.pure @@ -50,7 +50,7 @@ function <> meta::relational::transform::autogen::columnToProper ( name = $column.name->createSQLSafeName()->createValidPropertyName(), multiplicity = if($column.nullable == false, | PureOne, | ZeroOne)->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()->toOne(), - type = meta::relational::metamodel::datatype::dataTypeToCompatiblePureType($column.type)->toOne()->elementToPath() + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath = meta::relational::metamodel::datatype::dataTypeToCompatiblePureType($column.type)->toOne()->elementToPath())) ); } @@ -138,7 +138,7 @@ function <> meta::relational::transform::autogen::generateAssoci ^meta::protocols::pure::vX_X_X::metamodel::domain::Property( name = $propertyName->createSQLSafeName()->createValidPropertyName(), multiplicity = $multiplicity->meta::protocols::pure::vX_X_X::transformation::fromPureGraph::domain::transformMultiplicity()->toOne(), - type = $packageStr + '::' + $schemaName + '::' + createValidClassName($tableName) + genericType = ^meta::protocols::pure::vX_X_X::metamodel::type::GenericType(rawType=^meta::protocols::pure::vX_X_X::metamodel::type::PackageableType(_type='packageableType', fullPath = $packageStr + '::' + $schemaName + '::' + createValidClassName($tableName))) ); } @@ -255,8 +255,8 @@ function <> meta::relational::transform::autogen::generateRelati { let p1 = $association.properties->at(0); let p2 = $association.properties->at(1); - let p1ClassPath = $p2.type; - let p2ClassPath = $p1.type; + let p1ClassPath = $p2.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath; + let p2ClassPath = $p1.genericType.rawType->cast(@meta::protocols::pure::vX_X_X::metamodel::type::PackageableType).fullPath; let p1ClassName = getClassNameFromClassPath($p1ClassPath); let p2ClassName = getClassNameFromClassPath($p2ClassPath); let associationAlias = $join.aliases->at(0);