Ellen Gambrell Pelletier's picture

Hi - I am trying to halt users from creating all but a 3 model types. We need users to be able to see other model types, but not generate them (so this is not something we can do via the filter).

I created an event-driven macro with:

  • Event: "Model is to be created with type and name (Vetoable)"
  • Can only be started by an event
  • "Use veto against default creation" is checked
  • Triggers are report with the code below
    var modelType = Context.getProperty("model_type");
    if (!containsInt(allowedTypes, modelType)) {
        Dialogs.MsgBox("You are not allowed to create this model type.\nPlease contact the admin team if you believe you are seeing this in error.");
        Context.setProperty("event.veto", 1);
    } else {
        Context.setProperty("event.veto", 0);

The macro works in generating the dialog box on the other model types, but it vetos creation regardless of model type. 

When I look at the code of the auto-generated macro, the last line is

Context.setProperty("event.veto", 1);

Why is the macro setting it to veto no matter what? Isn't the entire purpose that it should be vetoed or not according to what happens in the report?

How do I have it still allow the creation of the three allowed model types and ensure it opens properly in Connect?

Tags: ARIS 10 ARIS Connect macro Report