RK

As you know, we have implemented a feature to alow users to create a documentation for objects/models. It is implementated for ARIS Connect (SR16). 

The content is stored as an HTML string in an aris attribute (images are stored on ADS). To be possible to use content of the attribute in reports we implemented an API (SR18) that loads images from ADS, transforms them to a byte array and includes it into the generated content. The API is implemented for models and objects and is described in the ARIS help (search for "HTMLAttribute"). .

Here is a simple example:

function main() {    
   var outputFile;        
   var model = ArisData.getSelectedModels()[0];    
   var attr;        
   attr = model.Attribute(Constants.AT_HTML_DOC, Context.getSelectedLanguage());
   outputFile = Context.createOutputObject(Context.getSelectedFormat(), Context.getSelectedFile());     
   
   // here we use the string as a parameter for the function OutputFormattedText(), 
   // the second parameter must be set to false, to ensure that the report will show html content not a string representation of the attribute
   outputFile.OutputFormattedText(getHTMLAttribute(model), false);
   outputFile.WriteReport();
}

// this function provides content from the attribute
function getHTMLAttribute(item) {    
  var html = Context.getComponent("HTMLAttribute");    
  // in the backgroud we load all images, transform them to a byte array and 
  // include the array into the html string
  str = html.getHTMLContent(item, Context.getSelectedLanguage(), false);    
  return str;
}
main(); 

 

by Jens Heylmann
Posted on Thu, 08/25/2022 - 08:56

Great example. Thanks for sharing!

1

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