Dear ARIS community,
I am trying to learn how to create makros in ARIS.
Unfortunately, I am not able to find some good tutorials. So, I am wondering whether any of you can help me with my concrete use case (pls bear in mind, that I don't have any idea how to use it :
If the connection "must be informed about" has been created between a function and a role, then
==> I would like the makro to add a value "I" to the attribute "f3c650c1-9df8-11e7-0e01-005056b10029".
"I" is a dropdown-value, so "I" has the GUID: f3cd7cd3-9df8-11e7-0e01-005056b10029.
It would be awesome if you could provide me the code for this use case so that I can play with it ;)
Thanks a lot for your support.
Best,
Veronika
Hello Veronika,
just my 2 cents: If you are working with the Java Clients it is fine to use a macro for that purpose. But if you also use the Connect Designer, such macros do not help you, because they only can work in and with the Java clients. However you can trigger some macros in the Web client as well, but they are limited to executing a server-side report. There are quite a few events that can be defined as triggers for macros. My suggestion here would be the event "On save" of the model. You can define a report that will be executed (on the server) by the macro. This way you could set your attribute value for all connections in the model based on the the AT_TYPE attribute. I assume you defined your attribute as read-only, because it never changes as long as the connection exists?
Best regards.
Hello Veronika,
scripting tuorials are here in the community: ARIS scripting tutorials
A report script to address your use case was posted by Thierry Caro here (search for "Set the attribute RASCI_Letter"). In your case for a user defined attribute you would need
ArisData.ActiveFilter().userDefinedAttributeTypeNum("GUID");
instead of using the attribute type number.
The macro scripting API uses other methods than the report API, e.g. "Designer.setAttribute() ..."
//+++ Kantenrolle ändern und positioniert anzeigen
function fktKantenrolle(oModel, oSelectedCxns, oSelectedCxnOccs, oAllDBLanguages, sAttribut)
{
Designer.setAttribute(oModel, oSelectedCxns, Constants.AT_CXN_ROLE, sAttribut, oAllDBLanguages);
Designer.createAttrOcc(oModel, oSelectedCxnOccs, Constants.ATTROCC_LEFT, Constants.AT_CXN_ROLE, Constants.ATTROCC_ALIGN_CENTER, Constants.ATTROCC_TEXT);
}
But as M.Zschuckelt pointed out a user-defined macro cannot be used to handle Connect Designer events. It is only suitable to be run in Architect/Designer (c.f here)
Also you might think about slowing the user's flow by automating too much on the client side.
A report script can be used more flexible after saving the model or refining a bunch of selected models in both environments Connect and download client.
More about macro events
Regards, Martin
Hi Robert,
Yes, that would be an option, too. Unfortunately, my colleagues do not like that too much. They prefer choosing the connection with proper name like "must be informed about". So, this is why I was looking for a work-around.
And I thought it might be a cool idea to familiarize with macros in ARIS because I have never used them before :)
Thank you anyways!
Best,
Veronika