question-circle How do I in jython create ArchiMate Requirement model elements ass. to a BP

3 months 1 day ago #5447 by craae
I have been looking for API functions that are capable of creating ArchiMate.Requirement objects from jython code - In addition how do I (in code) generate/create views with selected ArchiMate model elementelements

BR
Claus

Please Log in or Create an account to join the conversation.

3 months 1 day ago - 3 months 1 day ago #5448 by craae
Can the
createElement
method do it?
The method doesn't seems to be available in jython code, is that correct?
The auto generation of elements and views are critical for our usage of Modelio, so I would be grateful to get some guidance/info
I just want in code to do similar to this in the UI
Attachments:

Please Log in or Create an account to join the conversation.

2 weeks 4 days ago #5529 by defu
I think the solution would be similar to mine at
www.modelio.org/forum/19-scripts/4445-cr...m-jython-script.html

Please Log in or Create an account to join the conversation.

2 weeks 4 days ago #5530 by pan
Hello,

Actually defu is right however ArchiMate has its own metamodel so you need to make some adaptations to his code.

This is an example for creating a Strategy Folder
sf = Modelio.getInstance().getModelingSession().getModel().createElement("StrategyFolder")
sf.setName("archimate element")
sf.setOwnerFolder(elt)

elt is the first select model element. In my example I selected a Strategy Folder.

If you want to create a Requirement in a Motivation Folder:
req = Modelio.getInstance().getModelingSession().getModel().createElement("Requirement")
req.setName("archimate requirement")
req.setOwnerFolder(elt)
In this example I selected a Motivation Folder.

Hope this helps.

Please Log in or Create an account to join the conversation.

Moderators: chmcma
Time to create page: 0.138 seconds
^ Back to Top