Profile picture for user fnavarro

Hello,

I've noticed that coding using custom attribute types can be a little tricky for different reasons:

  • Even thoug they suppose to be static, I've noticed custom attribute type numbers can change over time for different reasons. This has a direct impact on you code.
  • You have to keep those numbers defined as global variables in your code and keep them updated.
  • When you are working on the scripting module, you always have to switch to Admin module in order to know the custom attribute type number.
  • This same problem happens with custom object or model types.

 

Can anyone out there explain what is the best way to work with this kind of attributes?

 

Best regards

by Cezmi Eroglu
Posted on Wed, 07/21/2010 - 22:25

Hello Fernando,

Best method to work with user-defined attributes is to use the GUIDs which are unique and constant. Here is an example for macros:

var metamodel = Context.getArisMethod();

var attRef =  metamodel.UserDefinedAttributeTypeNum("67e9d210-748a-11df-76b7-003005a85e34");

Basicly, you get the attribute type number by GUID. Hope this helps.

Best Regards,

Cezmi

  hvar metamodel = Context.getArisMethod();   var targetObj=Constants.ST_OBJECT_1; var attRef =  metamodel.UserDefinedAttributeTypeNum("67e9d210-748a-11df-76b7-003005a85e34"); 
0
by Fernando Navarro Author
Posted on Wed, 07/21/2010 - 22:48

Thank you very much Cezmi, that's really helpful!

What if I work with two ARIS enviroments (eg. Localhost and productive servers)? Would I still have to change the GUID values from one server to the other?

 

Best

0
by Cezmi Eroglu
Posted on Thu, 07/22/2010 - 08:55

In reply to by jasseins

Dear Fernando,

You need to change the GUID values according to the environment. I guess they are assigned at the time of creation, so same attributes have different values in different environments.

 

Best Regards,

Cezmi

0
by Ellen Gambrell Pelletier
Posted on Thu, 07/22/2010 - 16:19

Hi Fernando -

Cezmi is right that you need to change the GUID values according to the environment if you are creating the attribute types separately on each one.

The workaround for this is to create the attribute types on one environment (your localhost, for instance), export your filter with the new attribute types included in it, then import that filter onto your production server. By importing the filter, the attributes will have the same GUID values on both servers. This allows you to use them in your custom reports without having to change the GUID values.

- Ellen

0
by Fernando Navarro Author
Posted on Thu, 07/22/2010 - 16:36

Cezmi / Ellen,

Thank you guys! This helps a lot!

0
by Christine Just
Posted on Tue, 09/28/2010 - 17:20

Thank you, Cezmi for the example above.

I'm currently trying to work with user defined attributes in a report and somehow, I'm missing something.

For macros and transformations there's the method "getArisMethod()" within the global object "context" which gives me access to the ArisMetaModel class.

For reports an semantic checks, the method "getArisMethod()" does not exist and I can't find any other method that gives me access to the ArisMetaModel class - or maybe I'm looking in the wrong places.

Could somebody please give me a hint? Thanks a lot!

0
by Martin Schröder
Badge for 'Contributor' achievement
Posted on Wed, 09/29/2010 - 18:53

It is not easy to find in Aris Script Help (SR2010_06):

Report script accesses the Aris Metamodel by means of the active method filter. so you can try:

oArisMetaModel = ArisData.ActiveFilter();

Regards, Martin

0
by Leonardo Pineda
Posted on Mon, 02/28/2011 - 20:58

Hi

Thank you very much, this is very useful.

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