Would be grateful for a few pointers:
Scripting the creation of service model that links to a selected capability, and generating a) a view for each service and b) an updated Service model showing all that link to the capability.
Questions
- I want to use Grouping around some concepts - cant seem to find the correct JArch commands
- As I can be sure how many services etc, doing a fixed layout is difficult, is there any JArchi Commands to do auto layout (beautify etc)
Any other pointers in this direction gratefully received, as I am learning better by example
By "grouping" do you mean adding concepts to folders? If so, see https://github.com/archimatetool/archi-scripting-plugin/wiki/jArchi-Object#add
Or do you mean creating a visual Group in a View? See https://github.com/archimatetool/archi-scripting-plugin/wiki/jArchi-Object#createobject
There are no commands in core jArchi for auto-layout. Perhaps someone else has written a script for this? If not, then it would be possible for someone to write one (not my speciality, I'm afraid).
Not folders, (have that based on your previous help) but the grouping (grey box) for readability..
OK, for Groups see https://github.com/archimatetool/archi-scripting-plugin/wiki/jArchi-Object#createobject
Sorry to be a pain.
I am able to create the group as shown, what I ant to do is include series of elements e.g grouping all business services in a Group, or all the application services etc. While I can paint one on top of the other it does not mean they are included within, hence move with it, as would be the case when i do it manually.
Trying to block bits of the view (dynamically)
You have to add the concept to the group. For example:
// Select first view
var view = selection.first();
// Create and add a group
var group = view.createObject("group", 10, 200, -1, -1);
// Create a Business Actor concept and add to model
var actor = model.createElement("business-actor", "Oscar");
// Add this to the Group
group.add(actor, 10, 10, -1, -1);
Here are some more examples - https://gist.github.com/search?utf8=%E2%9C%93&q=%23jarchi+extension%3Aajs&ref=searchresults
Thanks. One Step at a time ...
Hi,
For layout, you can leverage existing JavaScript libraries like dagre (https://github.com/dagrejs/dagre).
You can also look at Herve's script which uses dagre and other libraries: https://forum.archimatetool.com/index.php?topic=639.msg3563
Regards,
JB