HO

Hello 

I m trying to work on a macro trigered with the event "l'objet doit étre changé lors de la modélisation"

If an attribut if changed with modeling a treatement will be executed based on the new value of the attribut. 

The macro is trigered before i set the new value of the attribut and not after, so the argument withe the key 1 (the new value of the attribut)  is always empty.

 

this is my code traiting the event :

    var id = Context.getProperty(Constants.EVENT_ID)
    var arg = Context.getProperty(Constants.EVENT_ARGUMENTS)
    var keys = arg.getKeys()
    var arguments = new String();
    for(var i=0; i<keys.length; i++)
        arguments = arguments + keys[i]+ ": " + arg.getValue(keys[i]) + "\n";
    Dialogs.MsgBox("Event: "+id+"\n"+arguments)

 

The argument with the key 1 is always : ?

 

Thanks for your help

Omar

 

by Hammami Omar Author
Posted on Tue, 01/17/2023 - 13:22

the name of the macro eventin english is "object attrbute is to be changed by modeling"

0
by Martin Schröder
Badge for 'Contributor' achievement
Posted on Wed, 01/18/2023 - 16:32

Hello Omar,

obviously the new attribute value needs to saved befor you can evaluate it, so the trigger EVENTID_OBJECT_ATTRIBUTES_CHANGED should do the trick.

The property EVENT_ARGUMENT_ATTRIBUTES gives the list of changed attribute names by which you can get the saved attribute value.

But you should consider that this macro may be triggered quite often and slow down modeling. If you want to react to the value of exactly one attribute you could reduce load listening to EVENTID_MODEL_BEFORE_SAVE instead.

Regards, Martin

0
by Hammami Omar Author
Posted on Thu, 01/19/2023 - 09:24

In reply to by smarty

Hello Martin,

Thanks for the reply,

In a recent release of Aris, the event i used worked, the attribut is changed and then the macro is trigered and i can get the new value of the attribut. It does slow down the modeling,

What i m tring to do is fill attributs based on the value of other : Exempel : the gravity of a risk based on impact and probability and so on.

Also there is another feature that i needed in this context : is attribut with selectble value based on the value of another attribut : If Attribut A=1, Attribute B can be 1.1; 1.2 or 1.3

                            If Attribut A=2, Attribute B can be 2.1; 2.2 or 2.3

But support said this is not possible in Aris.

Regards, Omar

0

Featured achievement

Rookie
Say hello to the ARIS Community! Personalize your community experience by following forums or tags, liking a post or uploading a profile picture.
Recent Unlocks

Leaderboard

|
icon-arrow-down icon-arrow-cerulean-left icon-arrow-cerulean-right icon-arrow-down icon-arrow-left icon-arrow-right icon-arrow icon-back icon-close icon-comments icon-correct-answer icon-tick icon-download icon-facebook icon-flag icon-google-plus icon-hamburger icon-in icon-info icon-instagram icon-login-true icon-login icon-mail-notification icon-mail icon-mortarboard icon-newsletter icon-notification icon-pinterest icon-plus icon-rss icon-search icon-share icon-shield icon-snapchat icon-star icon-tutorials icon-twitter icon-universities icon-videos icon-views icon-whatsapp icon-xing icon-youtube icon-jobs icon-heart icon-heart2 aris-express bpm-glossary help-intro help-design Process_Mining_Icon help-publishing help-administration help-dashboarding help-archive help-risk icon-knowledge icon-question icon-events icon-message icon-more icon-pencil forum-icon icon-lock