Generate code from xml

A couple days ago I stepped over MPS. It seems like a good tool for my use case. Nevertheless, after reading through the fast track tutorial and searching in the community, I'm still not sure where to continue. Therefore, I will describe my use case briefly and hope, that you guys can show the right direction. Thanks in advance!

Use Case

My aim is to generate code for a web service based on a bunch of different BPMN models. Basically each model will result in one method. I already have the models in a nice XML-based format, which comes out of a graphical BPMN-editor. I thought about a small language which can specify the model a little more and then generate the code based on BPMN-model and its specification.

My Ideas so far

Because of the nice modeller, I already have, I thought somehow importing these models might be the based way to go. My ideas are now to go with one of the two:

Question

  • Which one of the above ideas right? Or what is a good starting point if both are not?

Comments

  • Maybe, I am completely wrong with my idea to use the MPS framework for my use case. Please point that out.
  • Maybe, another question/answer in this community already answered it. Please point that out as well ;).
2 comments

If you only want to import your xml files into MPS in order to manipulate them in MPS and generate them, then an importing action would be appropriate.

Use custom persistence if you want to iteratively work with your models in MPS as well as in your own tool, while sharing the files with your models between the two tools.

Vaclav

 

1

That sounds like actions are the right thing for me. So for trying to learn what they are I followed this tutorial by Mr. Tomassetti. This works fine.

So I can basically import a file. But now the following questions appear:

  • How do I make the content of the file accessible for the generator?
  • How can I access them via an editor in MPS?
  • How do they get into an AST?

I'm very dissatisfied, but because I don't find any tutorials that seem to help me, I have to ask again.

Thanks!

Soren

0

Please sign in to leave a comment.