Skip to content

Commit

Permalink
Fix pure to protocol to handle primitive types
Browse files Browse the repository at this point in the history
  • Loading branch information
aziemchawdhary-gs committed Nov 13, 2024
1 parent 359259b commit 3ceff7c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,14 @@ function <<access.protected>> meta::protocols::pure::v1_33_0::transformation::fr

function meta::protocols::pure::v1_33_0::transformation::fromPureGraph::findTypesFromPureInstanceSetImplementation(p:PureInstanceSetImplementation[1]):Type[*]
{
let srcClass = $p.srcClass->cast(@Class<Any>);
$p.class->concatenate($srcClass)
->concatenate($srcClass.constraints->map(c|$c.functionDefinition.expressionSequence->evaluateAndDeactivate()->map(e|$e->scan())))
->concatenate($srcClass.constraints->map(c|$c.messageFunction.expressionSequence->evaluateAndDeactivate()->map(e|$e->scan())))
->concatenate($p.propertyMappings->filter(x | $x->instanceOf(PurePropertyMapping))->cast(@PurePropertyMapping).transform.expressionSequence->evaluateAndDeactivate()->map(e|$e->scan()));
if($p.srcClass->isNotEmpty() && $p.srcClass->toOne()->instanceOf(Class),
| let srcClass = $p.srcClass->cast(@Class<Any>);
$p.class->concatenate($srcClass)
->concatenate($srcClass.constraints->map(c|$c.functionDefinition.expressionSequence->evaluateAndDeactivate()->map(e|$e->scan())))
->concatenate($srcClass.constraints->map(c|$c.messageFunction.expressionSequence->evaluateAndDeactivate()->map(e|$e->scan())))
->concatenate($p.propertyMappings->filter(x | $x->instanceOf(PurePropertyMapping))->cast(@PurePropertyMapping).transform.expressionSequence->evaluateAndDeactivate()->map(e|$e->scan()));,
| $p.class->concatenate($p.srcClass);
)
}

function <<access.private>> meta::protocols::pure::v1_33_0::transformation::fromPureGraph::buildDomain(found:AllTypes[1], associations:Association[*], extensions:meta::pure::extension::Extension[*]):meta::protocols::pure::v1_33_0::metamodel::PackageableElement[*]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,14 @@ function <<access.protected>> meta::protocols::pure::vX_X_X::transformation::fro

function meta::protocols::pure::vX_X_X::transformation::fromPureGraph::findTypesFromPureInstanceSetImplementation(p:PureInstanceSetImplementation[1]):Type[*]
{
let srcClass = $p.srcClass->cast(@Class<Any>);
$p.class->concatenate($srcClass)
->concatenate($srcClass.constraints->map(c|$c.functionDefinition.expressionSequence->evaluateAndDeactivate()->map(e|$e->scan())))
->concatenate($srcClass.constraints->map(c|$c.messageFunction.expressionSequence->evaluateAndDeactivate()->map(e|$e->scan())))
->concatenate($p.propertyMappings->filter(x | $x->instanceOf(PurePropertyMapping))->cast(@PurePropertyMapping).transform.expressionSequence->evaluateAndDeactivate()->map(e|$e->scan()));
if($p.srcClass->isNotEmpty() && $p.srcClass->toOne()->instanceOf(Class),
| let srcClass = $p.srcClass->cast(@Class<Any>);
$p.class->concatenate($srcClass)
->concatenate($srcClass.constraints->map(c|$c.functionDefinition.expressionSequence->evaluateAndDeactivate()->map(e|$e->scan())))
->concatenate($srcClass.constraints->map(c|$c.messageFunction.expressionSequence->evaluateAndDeactivate()->map(e|$e->scan())))
->concatenate($p.propertyMappings->filter(x | $x->instanceOf(PurePropertyMapping))->cast(@PurePropertyMapping).transform.expressionSequence->evaluateAndDeactivate()->map(e|$e->scan()));,
| $p.class->concatenate($p.srcClass);
)
}

function <<access.private>> meta::protocols::pure::vX_X_X::transformation::fromPureGraph::buildDomain(found:AllTypes[1], associations:Association[*], extensions:meta::pure::extension::Extension[*]):meta::protocols::pure::vX_X_X::metamodel::PackageableElement[*]
Expand Down

0 comments on commit 3ceff7c

Please sign in to comment.