HM

I am working on an automated process for creating standardized models.  I have succeeded in writing a report which creates  customized template models.  However, within the report I was unable to place the name of the model on the model graphic.

I am attempting to write a macro which places the name of a model (as an attribute) automatically, when there is no existing placement on the model.  This would allow me to either select models from the ARIS explorer or standardize name placement upon the model initially being created.

The current code that I have written is here:

function formatModel(model)

 {

     //opens a model that is modifiable, invisible, and is allowed to display error dialogs.

     Designer.openModel(model, false, false, false);

     

     var nameAttr = Designer.createAttrOcc(model, null, Constants.AT_NAME, Constants.ATTROCC_ALIGN_LEFT);

     

     Designer.save(model);

     Designer.closeModel(model);

     

 }

The difficulty lies in the 'createAttrOcc' function, which in this case is returning a null pointer exception.  The documentation that I have for this method is here:

The problem I am having is that I can't determine what to put in the 'occ' parameter.  When a model is first created, there are no occurrences placed on the model.

Does anyone know a way around this issue?

THANKS!

by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Sun, 04/09/2017 - 09:42

Hi,

well with this methode, you are trying to create an attribute placement for an object occurrence. There is another method for creating a text occ which can either be a free form text or an attribute placement of the model.

And this also works for reports !

BR Robert

0
by Robert Goldenbaum
Badge for 'Question Solver' achievement
Posted on Sun, 04/09/2017 - 09:43

It must be something with an x and y value - otherwise, the script would not know where to create the attr placement in the model...

0
by Haden McAfee Author
Posted on Mon, 04/17/2017 - 22:26

That definitely does the trick.  Thank you!

0

Featured achievement

Genius
You like to help others solve their problems by answering questions.
Recent Unlocks
  • KF
  • KH
  • RG
  • Profile picture for user Vee_ARIS
  • Profile picture for user smarty
  • PacMan

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