Dear Experts , The macro should fetch user defined attributes from DB when the new model (any type ) is created .Iam having the userdefined attributes Types : Model Name , RCM Change History , Model Version and Model Status . var DB = Context.getSelectedDatabases(); var g_nLoc= Context.getSelectedLanguage(); //Evaluate the result for(var i=0; i
Hi Ellen,
Thanks for your support .
I had tried with above code as you suggested ,this macro is getting trigered when iam creating new modle with out any issues .But its not retrun back the required attibutes from DB in Model Attributes Names - Still iam getting default ARIS Attributes only .
Finnaly i required all usedefined attributes , these userdefined attributes needs to be populate along with defalut attributes when the new model is created .
Much appriciated if any help provided for this . Thanks
Regards,
Rams.
Hi Ellen ,
Here iam trying to fetch the user defiend attributes not attribute values , in my case we have user defined attributes types like Model Version , Model Owner and RCM Change history ..etc .
When we crate a new model in designer default attributes are coming automatically (Type ,creator ,Last change and Last user ) . Along with these default attributes i need push user-defined attrubutes also (as mentioend above ) .
So finally when i create new model there should be 7 attributes in that Model Attributes list .
Regards,
Rams.
Then I think the issue is that when you are saying above that you are pulling database attributes, you don't actually want them. You want to just set the model attributes.
// get the filter var oMethodFilter = Context.getArisMethod(); // get the user-defined attributes var attrRCM = oMethodFilter.UserDefinedAttributeTypeNum("GUID"); // event should only be run on one model at a time, so get the first in the array var oModel = Context.getSelectedModels()[0]; // set the value of the RCM attribute on the model to "new value" Designer.setAttribute(oModel, oModel, attrRCM, "new value", null); // set the values of the other attributes below // save the model with the new attributes Designer.save(oModel);
Hi Ellen ,
Thank you so much for your continues support so far .
Iam very sorry , still your not able to understand my problem .By using above your code we can find the userdefined attributes and set the attribute values for those attributes.
In my case i dont want to just set the model attributes. Here i need to pull the all userdefined attributes from DB and it should populate automatically when the new model was created .(Only empty attributes,i dont want set any values for those attributes ).
Example :- If we created 'XYZ' model in designer , the default attributes (Type ,creator ,Last change and Last user ) will appear in attributes tab with default values . By the same way my userdefined attibutes (without values ) should be appear in attributes tab along with default attributes for XYZ model .
BR ,
Rams .
HI Ellen Gambrell Pelletier. Your info is very helpfull.
Could please help me with the value of user defined attribute?
I want to get value of user defined attribute, how can I do?
Here my code:
var attrTypeNum123 = ArisData.getActiveDatabase().ActiveFilter().UserDefinedAttributeTypeNum("545bd7b0-4d03-11df-1048-005056902dfc");
var ocurrentobjdef = oobjdefs[i];
var ocurrentobjdef1 = oobjdefs[i];
var sObjBusiness1 = getAttributeValue(ocurrentobjdef1, Constants.attrTypeNum123);
outfile.TableCell(sObjBusiness1, 33, getString("TEXT18"), 10, Constants.C_BLACK, getTableCellColor_Bk(bColored), 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
Hi Baglan -
var sObjBusiness1= ocurrentobjdef.Attribute(attrTypeNum123, Context.getSelectedLanguage()).getValue();
outfile.TableCell(sObjBusiness1, 33, getString("TEXT18"), 10, Constants.C_BLACK, getTableCellColor_Bk(bColored), 0, Constants.FMT_BOLD | Constants.FMT_LEFT | Constants.FMT_VTOP, 0);
- Ellen
If all you want to do is display the user defined attributes, regardless of whether they have a value, then you don't need a macro to do it. You can set them in a filter against the model type.
Or, (and this would only work on a client by client basis),
1. You can open a model,
2. Select the 'more attributes' - choose the ones you want.
Hi Dave ,
Thanks for you comments on this .
Present we are fallowing the the same process, (manually Selecting the required attributes for model) .Here we are looking kind of automatic process to avoid below issues .
1) Some times our modeling team is missing to select the required attrubutes for that model and some times unwanted attrubutes are selecting ,later on we are hiding the those unwanted attributes .
2) Time taking process .
Please let know how can we set them in a filter against the model type.
Its really helpful if we gets any sutable to solution to avoid these concerns .Thanks
Br ,
Rams