RD

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

by Ellen Gambrell Pelletier
Posted on Wed, 08/21/2013 - 19:47
You can try something like this instead:   var oMethodFilter = Context.getArisMethod(); var attrRCM = oMethodFilter.UserDefinedAttributeTypeNum("GUID"); var oModels = Context.getSelectedModels(); var loginInfo = Context.getLoginInfo(oModels[0]); var DB = loginInfo.getDatabase(); var DBattrRCM = Designer.getAttribute(DB, attrRCM, null); if (DBattrRCM  != null)      var valueRCM = DBattrRCM.getValue(); .... etc.

 

0
by ramesh danda Author
Posted on Thu, 08/22/2013 - 08:07

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.

0
by Ellen Gambrell Pelletier
Posted on Thu, 08/22/2013 - 16:48

Perhaps I'm not understanding what you're trying to do. It sounds like you want to pull some values from the Database attributes that are maintained and push them to the Model attributes? Is that correct?

0
by ramesh danda Author
Posted on Fri, 08/23/2013 - 11:27

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.

0
by Ellen Gambrell Pelletier
Posted on Mon, 08/26/2013 - 17:25

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);
0
by ramesh danda Author
Posted on Thu, 08/29/2013 - 07:28

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 .

0
by Baglan Beisenov
Posted on Tue, 06/24/2014 - 14:28

In reply to by egambrell

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);

 

0
by Ellen Gambrell Pelletier
Posted on Tue, 06/24/2014 - 15:35

In reply to by beisenov_bu

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

0
by Dave Butcher
Posted on Mon, 09/02/2013 - 11:01

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. 

 

 

 

0
by ramesh danda Author
Posted on Mon, 09/02/2013 - 14:12

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

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