I have "Lang_A -> jetbrains.xml" and "Lang_B -> Lang_A" generators, but...

But I can NOT get xml files from Lang_B models.

What should I do ?

P.S.

Lang_B extends Lang_A that is Lang_B's concepts extend concepts from Lang_A.

P.P.S.

Files generation from Lang_A to xml is always performed properly.

Message was edited by:

        Alexey Groshev

0
7 comments
Avatar
Permanently deleted user

Hello,

There is no normal way of doing so in the current MPS version.I recommend you to wait to the next EAP version. In it it will be possible to require one mapping to be applied before another in generator properties.

We're going to release a new EAP version by the end of May.

0

You can trick MPS if you create generator

Lang_B -> jetbrains.xml

which actually generates Lang_B -> Lang_A

then, when you invoke 'generate to xml', both generators will be engaged

0

Igor, what does "actually generates Lang_B -> Lang_A" mean ?

As I understand:

- I should define mapping rules like: Lang_B.ConceptB -> Lang_A.ConceptA.

- Generator "Lang_A -> jetbrains.xml" will be called implicitly.

  

Am I right ?

0

Yes, it really works!

Thank you, Igor.

I discovered only one problem: if generation template contains reference to some node, this node must be also visible in a generated model. I think It's not very convenient.

0

Do you mean that some node referenced from source model is not visible from generated transient model?

0

No:

- Generator Lang_B -> Lang_A : I use reference to some node in generation template

- Source Model to be generated to xml : while generating I get an error - something about "null is not correct JDOM value", I can't remember the whole error text, but I think it happens because corresponding references used in generation templates can't be found in the source model.

- If I remove all reference nodes from generation template - no errors found.

- If I make references used in generator visible in the source model - everything works fine.

0

Please sign in to leave a comment.