MDriven Designer and Modlr extensions–exporting data


❗🕜 Warning: This article may contain outdated information. Consider before using any descriptions/solutions, otherwise, it may still be helpful. Help: Synonyms and name changes

Updated intro to this article

When working with plugins use MDrivenDesigner, use the menu file/plugins/open new meta-model for plugins - now you have the extended modelLayer MDriven Meta-model.

Old intro

As you model along with Modlr in VisualStudio or by using AppComplete, you collect a lot of knowledge about the domain you are modeling.

I have heard from many a need to access this information in a simple export format so that it might be shared with other tools or people. It has been hard to decide how such an export mechanism should be constructed to solve all conceivable needs in one glorious stroke.

As the need to export came up once more – and I was hard-pressed to resolve it – I created this solution and I am pleased with it.

The solution uses many of the model-driven concepts that MDriven introduced earlier.

The meta-model you use to hold the model you design is called ExtendedModelLayer. There is also a meta-model called ModelLayer. This model holds the knowledge about content in the model – like classes, attributes, associations, and state machines. The ExtendModelLayer adds diagrams, ViewModels, report definitions, Enterprise architecture information, and so on.

The Goal

This is what I want you to be able to do:

1. Define ViewModels with UI hints on the extendedmodellayer model.

2. Show those derived UIs from AppComplete and/or Modlr so that they get data from YOUR model.

3. Export any grid in such a derived UI to ODS-format-file (open document spreadsheet – works in Excel and others).

How It Is Done

1. Open AppComplete and click new (Yes, new! You do not do this in YOUR model – it is a NEW model of its own).

2. Right-click package, import/export, and Import from EcoSpace in Assembly (new function).

Modlr -1.png

3.  Locate the ExtendedModelLayer assembly in the install folder (C:\Program Files (x86)\ →MDriven\ECO\6.0\Modlr).

Modlr -2.png

4. Then, get all the packages and their content imported into your new model.

Modlr -3.png

5. Now you can create ViewModels for ExtendedModelLayer. You can do everything, including finding all classes with more than 3 attributes:

Class.allinstances->select(c|c.Feature->filterontype(Attribute)->size>3)

or all ViewModels in order by name:

Span.allinstances->orderby(name)

Remember that these ViewModels will execute on the ExtendedModelLayer that holds the instances that make up YOUR model. You decide what you want to see and how it should be presented. Maybe you want a list of all the constraints you have? Or of things that have a certain TaggedValue set? Gone are the days when you needed to ask us politely to expose some information – now you are empowered to get ANY AND ALL DATA you want.

6. Save the Modlr file to: %ProgramData%\CapableObjects\Plugins  (C:\ProgramData\CapableObjects\Plugins on my machine).

Modlr -4.png

7. Now restart AppComplete or Modlr (Visual Studio), open a model, and right-click Modlr tree:

Modlr -5.png

8. A form comes up, and executes your ViewModel definition on the extendedmodellayer that holds your model:

Modlr -6.png

9. It also holds Buttons at the bottom that create ods files for you, so that you can get the values in Excel:

Modlr -7.png

That is it.

Conclusion

Along with the plugin interface, this ViewModel plugin exposes every tiny detail of your model. With AppComplete and Modlr, you are never locked in. You can harvest all the information for any need you see fit – after all, it is your model.

Loading the ExtendedModelLayer into Modlr enables you to familiarize yourself with the meta-model we use.

Continued

I got a request to dump all processes and process steps from the EAInformation in Modlr.

Following the steps above, I created a ViewModel for ExtendedModelLayer:

Modlr -8.png

I save this Modlr file under: C:\ProgramData\CapableObjects\Plugins

While I have it open, I start a new instance of AppComplete and load the model that wanted to dump the processes:

Modlr -9.png

Right-click any node in the tree and pick the “Plugin Views” and the correct ViewModel:

Modlr -10.png

Great. If you do not like the result, fix it in AppComplete #1,  save, restart AppComplete#2, and try again:

Modlr -11.png

Better. Now I can press the “… To Excel” button:

Modlr -12.png

I have the selected data in an ods file that opens with Excel.

You can access ALL DATA in the extendedmodellayer so that is ALLDATA that builds up your model.

Once you have created one of these reports, it works for ALL MODELS you have now and in the future.

This page was edited 28 days ago on 06/17/2024. What links here