WE

Hi Everyone,

Is there a way that I can stop a user from closing a model, if one or more attributes are not captured?

I used a trigger event on a macro to start a report when a model is closed. The sequence then starts a QA report. The report is opened in Excel, and THEN the model is closed. I need the report / macro to either re-open the model or stop the user from closing the model...

Any ideas or workarounds that I can try?

Using ARIS 10.04....

Thanks,

Willem

 

by Kay Fischbach
Posted on Fri, 02/22/2019 - 13:24

Ok, this is actually a really cool task that you want to accomplish. I think it's a bit complicated to explain, but it's easy to implement once you understood the concept of it.

As described here reports are executed on the server, while macros are executed on the client.

Right now all your client does is say "hey server, could you execute the report with the GUID "GUID_GOES HERE", please? If there is any file created with that report, send it to me, I want to display it."

The parts your macro-report-combination is missing, is

  1. the part where your reports saves information whether or not the macro should close the model
  2. the part where your macro interprets the information saved by the report and makes use of it

Information can be passed from your report to your your macro with things called "properties". Each property consists of a string-key (it's an identifier) and a string-value (the actual information).

Here is what you want to do.

  1. Somewhere at the start of your report, you want to add the following line

Context.setProperty("dontClose", "false");

This creates a new property with the key "dontClose" and the string value "false"

  1. At some point in your report you'll have determined that your user didn't maintain an attribute (this is probably inside an if-block). At that point you're probably writing output to the results file, to notify the user later on where exactly they need to maintain the attribute. Add the following line to your report at that the point described above:
Context.setProperty("dontClose", "true");

This overwrites the previously defined property with the key "dontClose",  and sets the string value "true" for it.

  1. Next you want to edit your macro configuration. Right click it in the "Administration" tab, and select "Properties...". Select "Context" in the left menu bar, and ensure that your selected Event is "Model is to be closed (vetoable)". Then head to the "Content" page by selecting "Content" in the left menu bar, and change the selected radio button to "User-defined macro" (should have previously been "The macro runs this report:"). Close the "Properties" window by clicking ok.
  2. Ok, now the only thing remaining is telling the macro that the model is supposed to stay open when the reports delivers a property "dontClose" with the value "true". Double click your macro in the "Administration" tab to open the script-view of the macro. It should look something like this:
var selection;
var reportInfo;
var result;

selection = Context.getSelectedModels();
if(selection.length > 0)
{
    reportInfo = Report.createExecInfo("SOME_GUID_HERE", selection, Context.getSelectedLanguage(), Context.getSelectedOutputFormat(), Context.getSelectedOutputPath(), Context.getSelectedOutputFile(), Context.getEvaluationFilter());
    result = Report.execute(reportInfo, Context.getShowResult());
}

What you want to do is add a little bit of code close to the end of the code, after the "result = ... line, before the closing bracket.

if(result.getProperty("dontClose") == "true"){
        Context.setProperty("event.veto", true);
}

What does this do? It reads the property-value from the property identified with "dontClose" of the Report result, and compares the string of the property with the string "true". If the strings match, the macro will set one of its own properties, identified with the key "event.veto" to the value "1" (boolean true automatically translates to a "1" string).

What is "event.veto" you may ask? Because we picked an event for the macro execution, that had "(vetoable)" at the end, we are allowed to veto action of the user. For this to happen, ARIS automatically created a property when we started the macro, with the key "event.veto" and value "0". With this default value "0", the macro will not stop the model from closing. We switched it to "1", which tells ARIS "don't let the user do that thing". The model stays open, if the report-property-value and the "true" match.

That's it. Save everything and give it a try.

0
by Willem Engelbrecht Author
Posted on Tue, 02/26/2019 - 10:21

Thank you Kay Fischbach,

This resolved my problem completely.

I've attached an example of a QA report that was generated during my testing.

Willem

File attachments
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