I would like to create a macro to apply in process models in order to change the default color of the objects present in the models based on the value of one attribute of these objects.
In the next example, in case the value of the Description attribute is 1, then the color of the object should be 'black'.
I executed the macro without errors but nothing has changed in the model, the objects still have the previous colors.
Could you help me and suggest what I'm doing wrong?
Thanks in advance a lot for your collaboration
Kind regards
function main() { var selModels = Context.getSelectedModels(); var nLocale = Context.getSelectedLanguage(); var selobjs = Context.getSelectedObjects(); for (var i = 0; i < selModels.length; i++) { var oModel = oSelectedModels[i]; var oObjOccs = Designer.getOccs(oModel); for ( rr = 0 ; rr < oObjOccs.length ; rr++ ) { var valuation = Designer.getAttribute(oObjOccs[rr], Constants.AT_DESC, nLocale); if (valuation == 0) { Designer.setFillColor (oModel,oObjOccs[rr],java.awt.Color.BLACK) } } } }