Profile picture for user Volker Eckardt

Hello Aris Community,

today I like to share with you two simple examples how to implement extended semantic checks. The requirement is the following:

  • Semantic check for a "function attribute to be equal or greater than 5"
  • Semantic check for a "function attribute to follow a certain format, here CCC-NN-NN".

To implement such checks you need to work with JavaScript. This guide helps you to understand and implement your own validations.

Let's start!

1. We need to define our two custom rule types.

2. Right click on Administration > Evaluation > Semantic checks > Rule Types, and follow the wizard steps.

3. Enter the name and the context. In this case we will perform the checks on model level of type BPMN.

4. Accept the default output formats.

5. Now define the two rules itself. Notice that you have only to define a name here.

6. And this is the second rule definition:

7. Now we have the rules defined. Let's now check what code we already got. Switch over to the Script section and naviagte again to the just defined Rule. You will see two function fragments, we need now to define the check itself.

8. First we should define some globals, the language is important. The ruleTypeId is the Id you can get from the properties itself.

9. For the first function we will add some code, it mainly loops through the given model and through the objects in it (here functions only). The constant AT_BPMN_START_QUANT is the attribute you are going to check.

10. The validation is right here, I like to react in case the number is lower than 5 or not maintained. The additional code lines take care about the error reporting.

11.  Some more lines to provide a nice layout, and fill the statistic, if requested.

12. The code for the second check looks quite similar, whereas the semantic check itself and the error message are different. The attribute to check here is determined by the constant AT_ID.

13. The code closes with some helper functions for the sematic check printout.

13b. For sure we are maintaining the text elements in the string table (in German and English):

 

14. Now, as the checks itself are ready, we need to call them. I am using my own Custom Semantic Check profile for easier testing. You may also attach these new checks to other, already existing profiles.

15. Such a profile you can again define by using a wizard.

16. And in the second step you link the checks into it.

Now, let's test the two new check!

17. Right click on the model > semantic check. Choose your own profile, in my case it is the "Custom  Semantic Check".

18. Choose the output options. To get also the inline warnings and tool tip, check everything.

 

19. That's our result

 

20. And the inline warnings and tool tips are looking like this.

 

You can download the whole code from the links below:

I hope this example helps you to understand the strength of symantic checks in Aris!

Best Regards

Volker

by Sebastian Stein
Posted on Mon, 04/26/2010 - 09:54

Volker,

thank you very much for contributing this nice tutorial. I have added it to our list of free ARIS reports & macros.

0
by ben jones
Posted on Tue, 04/27/2010 - 00:31

Outstanding post. Thanks for putting this together, will save us a lot of time.

0
by Sergei Real-Picture
Posted on Sun, 06/27/2010 - 12:46

The most usefull ARIS JavaScript article so far!

Volker, I reckon you better copyright this article and sell to IDS SCHEER with the purpose they include it in the ARIS BA customisation manuals.

I wonder with ARIS developers obsession with GUID/ID usage as function names. I do understand that it is a way to go, but...

Noone can say that it is humane forcing people to use GUID as name of the function (not to mention the readability of the code) and do not have some sort of translation table (for machine code usage).

This reminds me mainframe programming in late 70th when introduction of mnemonic  names for commands (ADD/DEL/SUB) in assembler code was a break through from programming in codes (x0cBF/xbbA0/x870A).

Everytime I read ARIS codes I have a feeling of flying BACK TO THE FUTURE.

What do I like in this code - the highlights of the objects which has non-compliant elements.

Just curious, if someone will create XML file and will validate it against DTD - this will not require such acrobatics with dialogs, code, names and, in case of future changes, could save lot of time. Simply change DTD and continue validation.

In case of such style of semantic check rules programming it would be a hightmare to trace back validation rules no to mention their possible conficts?

Just wonder, is it possible to do XML validation inside ARIS SCRIPT?

Sergei.

0
by Michael Ferrari
Posted on Thu, 07/29/2010 - 12:49

Very interesting !

I was trying to adapt your script to check a string length in a certain attribute without sucess.

How would you do that ?

Any help appreciated :)

0
by Vincent Renard
Posted on Thu, 07/29/2010 - 15:42

Thank you Volker for your time. This will be very helpfull for the Aris community !

-> Michael,

you should use aValue.search + Regular Expression

To check a ten caracter string length :
aValue.search(/.{10}/) == -1

To check ten or less caracter string lengh :
aValue.search(/.{0,10}/) == -1

I'am sure this will answer your question ;)

Vincent

0
by Stephan Kaiser
Posted on Tue, 01/22/2013 - 14:50

Is it possible to set a mark to a model itself?

Some of my checks are related to the model and not to an object in the model.

In the profile I only find functions to mark an object.

0
by Bertrand G
Posted on Mon, 12/06/2021 - 17:07

In reply to by DerKaiser

Hello Stephan.

My answer comes in quite late, but may be of use to others, hopefully.

All kinds of attributes can be associated with models using the modeller (Details > Properties > Attributes).

I guess they can be used from the API too.

Some are proposed in the "Process automation" category that seem to fit your work, a.o. "semantic check successful", or "time of last semantic check"... but you can always define your own attributes, and use them to "mark" a model per your needs.

Regards.

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