HO

Hello,

I m trying to Apply a Template via Macro in Aris.

this is the code :

for(m=1; m<=mod.length; m++){
if (mod[m]!=undefined){
   if(mod[m].getType()=="65548"){
   
   Designer.openModel(mod[m], false, false, true);
   var op=false;
   for(var o=0; o<=Designer.getOpenModels().length;o++){
   if(Designer.getOpenModels ( )[o]==mod[m]){op=true;}}
       
   if(op==false){Designer.openModel(mod[m], false, false, true);}
      
Designer.applyTemplate(mod[m], Designer.getTemplateByGUID ( "cec94fe0-9af8-11ed-7b48-005056c00008"), Designer.getOccs(mod[m]));   
   
Designer.save(mod[m]);
 Designer.closeModel(mod[m]);
}
}}

 

the template of the model gets changed by the code, but not the effect of the template (placing an attribute under the objects).

If i do it manually in architect; the effect takes place.

Thanks

Omar  

by Martin Schröder
Badge for 'Contributor' achievement
Posted on Tue, 09/10/2024 - 18:09

Hello Omar,

I am not sure why you are trying to use the macro API when there is a standard report "format models" that does the trick. Probably there you will find the necesary method to apply a template.

Regards, Martin

1

Featured achievement

Question Solver
Share your expertise and have your answer accepted as best reply.
Recent Unlocks
  • CR
  • BH
  • Profile picture for user Ivan.Ivanov.softwareag.com
  • Profile picture for user mscheid
  • MS
  • 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