Generator switches from transient to original model

Hi,

although I fixed it already in my project using a workaround, I thought it might be worth to share this problem.

I encountered that in a mapping script (pre-process input model) the generator switches from the current transient model to the original one as soon as I try to resolve a reference using a "this"-pointer from within a concept's behavior. For instance,

node<SimpleConcept> simpleNode = new node<SimpleConcept>
nlist<AnotherConcept> = simpleNode.calculate()

Within calculate() we do the following:

public nlist<AnotherConcept> calculate() {
return (nlist<AnotherConcept> (this.internalExpression).expression.eval(null);
}

At this point we switch from the transient to the original model. This behavior caused me some headache because it took me some time to find out why MPS was asking for model access.

Is this desired behavior?

Cheers,

Ben

Please sign in to leave a comment.