How to: Programmatically disable/enable language generators?

Hi,

I'd like to programmatically disable/enable language generators in MPS.

The reason for this is that we have multiple RCPs for different stakeholders that work on the same models in production, but aren't interested in all generated artifacts.

My goal is to individually disable/enable generators for stakeholders, so that they just generate the artifacts that they need and don't waste computation time on unnecessary artifacts.

Does anyone know how to do this? I could do it with preconditions for each root mapping rule, but I think there might be a more elegant solution. :)

 

Best regards

Tobi

4 comments
Comment actions Permalink

you could use devkits for the models
in these devkits the plans decide which generators are invoked
by introducing properties that the generators lookup before generating they would know if they would be invoked

0
Comment actions Permalink

+1, generation plans were designed to use different set of generators for a model. In MPS,tThere's no support to switch plans on the fly/on demand, this functionality have to be created by language designer (i.e. whether it's distribution-controlled, or a dedicated action for user to invoke, or a specific 'perspective/workspace/role').

0
Comment actions Permalink

I think DevKits would not work in this case, because we have multiple root nodes in one model. Each root node is important to different stakeholders:

modelA:

  • Node1 (for stakeholder of domain X)
  • Node2 (for stakeholder of domain X, Y)
  • Node3 (for stakeholder of domain Y)

This means that each RCP has to have all languages of domain X and Y deployed to work with "modelA". If I use DevKits to selectively enable/disable generators, I have to split my model for the X, Y and XY domain and import a specific DevKit for each of them.

I guess implementing some approach to manually switch plans is the way to go in this case.

 

 

0
Comment actions Permalink

Could You provide a sample project for your use case on GitHub? I would be happy to look for an easy solution.

0

Please sign in to leave a comment.