Copying alert definitions from one system to another

You can copy the alert definitions that were created on one system onto another system.

About this task

When you have more than one system with similar sets of process applications, it might be easier to copy the alert definitions from one system and modify them instead of creating new sets of alert definitions for the other systems.

Procedure

  1. In the source system, use the following API to retrieve the alert definitions that you want to copy
    • REST:
      GET /rest/bpm/wle/v1/system/alertDefinitions[?categories={category1,category2,...}]
    • JavaScript:
      BPMAlertDefinition[] getAlertDefinitions(String[] categoryFilter , Boolean checkAuthorization)
    The filter is to retrieve just process instance alert definitions, just task alert definitions, or the alert definitions from both categories.
  2. Use the following API to save the alert definitions to the target system:
    • REST:
      PUT/POST /rest/bpm/wle/v1/system/alertDefinitions[?importMode=false]
    • JavaScript:
      BPMAlertDefinition[] saveAlertDefinitions(BPMAlertDefinition[], Boolean importMode, Boolean checkAuthorization)
    The importMode parameter determines the following behaviors:
    • Whether you want to save the alert definitions that are monitoring only the process applications, snapshots, and process (business process definition) that are on the server or save all of the alert definitions regardless of what they are monitoring.
    • Whether to update existing alert definitions or create new ones if there are matching names.
    If the importMode parameter is false, the default value, the alert definitions are saved only if the process application, snapshot, and process exists on the target system. If an alert definition with the same name already exists in the target system, the API updates that definition. If the importMode parameter is true, the alert definitions are saved regardless of whether the target system has the process application, snapshot, and process. If an alert definition with the same name already exists in the target system, the API generates a new name to create a different alert definition. This action preserves the original alert definition so that the original definition and the newly-saved definition can coexist.
    The API saves an alert definition if it complies with the following restrictions:
    • The name of the alert definition must be specified.
    • The threshold value and the operator must be specified and valid.
    • The instance status and the task status values must be empty or valid.
    • In the BPMAlertDefinition object, the projectId, snapshotId, and bpdId, properties are valid IDs in external String format and the category property has a value of INSTANCE or TASK. Alert definitions created in Process Admin Console have valid property values.
  3. Open the Process Admin Console on the new system.
  4. Review the imported alert definitions and edit them where necessary. In particular, the following fields might have strange values if what the definition is monitoring does not exist on the server:
    • Process App
    • Snapshot
    • Process

    For example, if you save an alert definition with the importMode parameter set to true and the snapshot being monitored by the definition does not exist on the target server, the snapshot field for the definition can have a set of random-looking characters. In this case, edit the alert definition to point to the appropriate snapshot.