KN

Hi, 

I am new to ARIS Reports and Scripts and I am using the design view for developing the script. I want to get the list of superior processes for a process represented in BPMN Collaboration diagram. Right now I am getting all the superior processes by using the {Selected models.Superior objects.Occurrences.Model.Name} which lists down the superior BPMN Collaboration diagram and Function allocation diagrams.

How do I filter to get only the BPMN Collaboration diagrams? I could not find any options to filter by Model type.

Could any one help me in getting this in design view?

Thanks & Regards,

Kanjana N

 

by Kay Fischbach
Posted on Tue, 08/07/2018 - 10:43

Hard to believe, but I think this is already where the WYSIWYG Editor (the "design view") is reaching its limits. This sub-conditional evaluation (only output previously collected data when the result of a sub-query meets a certain condition) is not something I would ever want to do with the design view. It is definitely worth looking into the script view, if you have any knowledge about JavaScript (or even if you don't, there is a first for everything).

You do not have to start from scratch: although it's not the best auto-code generation, the WYSIWYG editor can be used to create a skeleton of the code that you want to edit, basically you only have to add the conditioning to the already existing code. This is what your WYSIWYG editor should look like

screenshot of the wysiwyg editor

 

Note: You want to order the output of the model name already. The only thing that you want to add with the scripting is the conditioning.

Now save the report, close it, right click it in the admin tab of the Architect (where all the reports are listed) and select "Edit code". Note that editing the code is a one-way process. After editing the code and saving it in the script view, you will not be able to return to the WYSIWYG view. So make any additional edits (like modifying the header, etc.) before doing the scripting.

What you should see now is a bunch of confusing Javascript code, don't worry, I'll explain. You can ignore everything except this:

  function collect1(p_array){
   var result = new Array();
   for(var i=0; i<p_array.length; i++){
    result.push(p_array[i].Model())
   }
   return ArisData.Unique(result)
  }

This function should be somewhat close to the end of the code, make sure you are seeing the function "collect1" and NOT the function "collect".

The collect1 function is given a list of object occurrences (the occurrences from the superior object definitions) , it identifies the models of the occurrences, collects them in the result list, and in the end makes sure that the results are unique (that means, no same model will be given back multiple times).

All we have to do is ensure that the result list will only contain models of the BPMN Collaboration Diagram type. That's super easy. Modify your collect1 method to make it look like this:

function collect1(p_array){
   var result = new Array();
   for(var i=0; i<p_array.length; i++){
      if(p_array[i].Model().TypeNum() == Constants.MT_BPMN_COLLABORATION_DIAGRAM){
         result.push(p_array[i].Model())
      }
   }
   return ArisData.Unique(result)
  }

All you add is the line "if(p_array[i].Model().TypeNum() == Constants.MT_BPMN_COLLABORATION_DIAGRAM){

", and after the existing line with the "push" a line with a closing curly-bracket.

 

That's it. Save the edited report (confirm that you are aware of the fact that you can't return to the WYSIWYG view after manually editing the code), and you can run it like any normal report.

 

I hope this helps. If you have any additional questions, feel free to ask. Oh and no worries, if you've tackled a few of those problems with the skeleton-to-code-that-does-exactly-what-it-should-do approach, and learned more about javascript, you'll be coding like a champion and even starting your own report scrips from scratch. The advantage of scripting is that it's not only limited to evaluating what is already in the database, but you can also modify content of the database, like write custom import scripts for xml data, change a ton of attribute-values, and much more.

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