Status rules

Status rules control which actions should be presented to the user, and are used to build the menus or buttons that present options to the user.

The status rules do not control permission to use the actions, just visibility of the actions. The process steps themselves control permissions.

Each status rule specifies:

  • One or more statuses.

  • One or more user roles.

  • One or more actions.

Consider this simple set of status rules.

[
  {
    "status": "initial",
    "role": "user",
    "action": {
      "action": "hello",
      "caption": "Hello World"
    }
  }
]

This means that when the status is initial, users with a role of user should be offered the hello action, using the menu caption "Hello World".

The status, role and action can specify a single item or a list of items. There may be more than one status rule.

Different Metrici systems have different conventions for what can go in the action, depending on the type of application. For the process client, the action may contain:

action

The action to be executed.

caption

A caption for the action. Defaults to the action.

popup

Set to false to suppress popup (default is true). When shown within the process client, actions are shown in the activity panel rather than in popups. However, this may be required in some scenarios where the process is being used outside of the process client and a popup would not be appropriate.

disabled

Set to true to show a disabled link

html

Provide complete HTML of the action. This should include the surrounding li element. Use this to build new menu items that don't run actions.

url

Provide the URL of the action (the default is to auto generate depending on the action value.)

group

Group in which to put the button, which are used to arrange the menu items into separate groups. Default is 0. If using groups, use group 0 for expected next actions, 1 for optional next actions, 2 for things you can do any time and 3 for exceptional actions.

Lowest groups are shown at the top.

sequence

Sequence within group. Lowest sequences are at the top.

target

Target frame for link. Optional. (Typically used with a value of "_blank" to force links to open in a new tab or window.)

linkClass

Additional CSS class or classes to add to the link. Set to "loading" to show the loading page before loading the link, which can be useful for slow-loading options.

Typically only action, caption, group and sequence are set.

To create status rules, create a node of type library.process.StatusRulesType. On the first tab, call it Hello World Status Rules, and on the Status rules tab, paste the status rules JSON into the Status rules definition box.

Setting up status rules JSON

You don't need to set any bindings (those are used by other systems which use nodes as statuses.)