Policy Designer Deployment

Deploy Policy Designer for the First Time

The following table outlines the steps that you must complete to deploy and configure this module for the first time. These instructions assume that you have completed the steps for deploying the basic system architecture.

These tasks may be completed by multiple people in your organization. We recommend, however, that the tasks be completed in the order in which they are listed.

Important: The Policy Execution Service uses the MIJOB user account. MIJOB should be a Super User, should have its time zone set to UTC, and must not be locked out of any data source configured on the APM server. Any modifications to the security privileges of the MIJOB user account may lead to failure of the Policy Execution Service.
Note: The following settings also apply to Family Policies:
  • MaxSubPolicyDepth
  • MathNodeExecutionTimeout
Table 1. Procedure
StepTaskNotes
1Assign Security Users to one or more of the Policy Designer Security Groups and Roles.This step is required.
2Review the Policy Designer data model to determine which relationship definitions you will need to modify to include your custom equipment and location families, and as needed, modify the relationship definitions using Configuration Manager.

This step is required only if you store equipment and location information in families other than the baseline Equipment and Functional Location families.

3Configure Queue Settings for Policy Execution Service.This step is optional. You can perform this step if you want to modify the default retries, concurrency, or duplicate trigger timeout settings.
4Configure the Time Limit for Policy Execution.This step is optional. You can perform this step if you want to modify the policy execution time limit for the Policy Execution Service. By default, the policy execution time limit is 15 minutes per policy instance.
5Configure Execution Time Out Value for Math Node.This step is optional. You can perform this step if you want to modify the Math node execution time limit for the Policy Execution Service. By default, the Math node execution time limit is 5 minutes.
6Configure the SubPolicy Node for Policy ExecutionThis step is optional. You can perform this step if you want to modify the maximum depth of nesting for sub policies.
7Configure the Default Historical Readings Time Range for the OT Connect Tag node.This step is optional. You can perform this step to modify the default time range of retrieving Historical Readings for the OT Connect Tag node if a specific time range cannot be determined. By default, the OT Connect tag node will retrieve two years of HDA data.
8On the APM Server, stop and restart the Meridium Policy Execution service.This step is required. If your system architecture contains more than one APM Server, you must complete this step for every server that you want to use for policy execution.

You can review the log files for this service at C:\ProgramData\Meridium\Logs.

9Configure Queue Settings for Policy Trigger Service.This step is optional. You can perform this step if you want to modify the default retries or concurrency settings.
10On the APM Server, stop and restart the Meridium Policy Trigger service.This step is required.

If your system architecture contains more than one APM Server, you must configure the Policy Trigger Service on at least one APM Server.

You can review the log files for this service at C:\ProgramData\Meridium\Logs.

11On the APM Server, reset IIS. This step is required only if you have modified the time out value for the Math node execution or Policy Execution, modified the default historical readings time range for the OT Connect node, or modified the maximum depth for nested sub policies in the appSettings.json configuration file.
12Configure Policy Reference Clean Up Batch SizeThis step is optional. When you delete a record, the related policy instances and execution history gets deleted in the background. You can perform this step to modify and set the default batch size and sleep interval that runs in the background.
13Configure Alternative Query for Policy OverviewThis step is optional. The alternative query provides additional information on the most recent execution of each policy but may impact performance.

About the Asset Health Services

When you deploy the Asset Health Manager, OT Connect, and Policy Designer modules together, the services used by each module interact with each other in various ways. This topic summarizes those services and describes a standard system architecture containing the components used by all three modules.

Services Summary

The following services are used by the Asset Health Manager, OT Connect, and Policy Designer modules:

  • Asset Health Indicator Service: Automatically updates the following field values in a Health Indicator record when reading values related to the health indicator source record (for example, an OT Source Tag or Measurement Location record) change:
    • Alert Level
    • Last Reading Date
    • Last Char Reading Value (for records that accept character values)
    • Last Numeric Reading Value (for records that accept numeric values)

    This service also facilitates the automatic creation of Health Indicator records for configured sources.

  • Policy Trigger Service: When an input to a policy (that is, an associated record in the APM database or reading value in the process historian) changes, when a policy schedule is due, or a user submits an Execute Now request, a message is added to the policy trigger queue. The Policy Trigger Service monitors the trigger queue. When it receives a message, it determines which policy instances should be executed for the message, and then it sends corresponding messages to the policy execution queue. Even if your APM system is configured with multiple Policy Execution servers, only one policy execution queue is used.
  • Policy Execution Service: The Policy Execution Service handles the execution of policies. Specifically, the Policy Execution Service monitors the policy execution queue and executes the policy instances that are added to it. If the APM system is configured with multiple Policy Execution servers, when each Policy Execution Service completes the execution of a policy instance, it will execute the next instance from the shared policy execution queue. In this way, the policy execution load is automatically balanced across all available Policy Execution Services.
  • OT Connect Service: Monitors the subscribed tags (that is, tags that are used in policies and health indicators) and when data changes occur on these tags adds messages to the appropriate queues. This service also facilitates the automatic import and synchronization of tags from a configured OT Source. For more information, refer to the OT Connect section of the documentation.

Standard System Architecture Configuration

The following diagram illustrates the machines in the APM system architecture when the Policy Designer, OT Connect, and Asset Health Manager (AHM) modules are used together. This image depicts the standard configuration, where the OPC Server software and the OT Connect Adapter Service are on the same machine.

Note: In this example configuration, only one machine of each type is illustrated. Your specific architecture may include multiple APM Servers, multiple OPC Servers, or multiple APM Servers used for policy executions.

The following table summarizes the machines illustrated in this diagram and the software and services that you will install when you complete the first-time deployment steps for Asset Health Manager, OT Connect, and Policy Designer.

MachineSoftware InstalledService Installed with APM Software
APM ServerAPM  Server softwareAsset Health Indicator Service
Policy Trigger Service
Policy Execution Service
OT Connect Conductor Service
OPC ServerGE Vernova OT Connect Adapter softwareOT Connect Adapter Service
OPC Server softwareN/A
Process HistorianProcess historian softwareN/A

About Policy Execution

Policy designers can configure a policy to be executed on a schedule or automatically when records or reading values associated with the policy are updated. Policies may also be executed on demand. This topic describes the ways that the items configured in the first-time deployment workflow facilitate each type of policy execution.

Note: Only the active instances of active policies are executed.

Automatic Execution

When any record or reading value is updated by the APM Server, or when a reading value for a tag associated with one or more policies is updated on the process historian, a message is added to the policy trigger queue. The Policy Trigger Service monitors the trigger queue. When it receives a message, it determines which policy instances should be executed for the message, if any. Only active policy instances associated with the record or reading update will be executed. The Policy Trigger Service then sends corresponding messages to the policy execution queue for each relevant policy instance. Finally, a Policy Execution Service executes each policy instance that was added to the policy execution queue in turn.

Scheduled Execution

When a scheduled policy is due, a scheduled job adds a message to the policy trigger queue. The Policy Trigger Service monitors the trigger queue and sends messages to the policy execution queue for each active instance of the policy. Finally, a Policy Execution Service executes each active instance that was added to the policy execution queue in turn.

On Demand Execution

When you request a policy or policy instance execution from the Policy Designer user interface, or select a hyperlink configured to execute a policy or policy instance, a message is added to the policy trigger queue. The Policy Trigger Service monitors the trigger queue and sends messages to the policy execution queue for each active instance of the policy. Finally, a Policy Execution Service executes each active instance that was added to the policy execution queue in turn.

Configure Queue Settings for Policy Execution Service

About This Task

The Policy Execution Service processes messages from queues, which are managed by ActiveMQ. The Policy Execution Service provides the following queue configuration options:
  • Retries
  • Redelivery attempts and interval
  • Concurrency limit

Increasing the concurrency limit allows the policy execution service to process more messages in parallel, resulting in higher throughput of policy executions, provided that the system has available resources. Reducing the concurrency limit reduces the policy execution throughput and the system resources used by policy execution. APM recommends that the concurrency limit be less than or equal to the number of logical processors on the APM Server used for policy executions.

Procedure

  1. On the APM Server, access the folder that contains the Policy Execution Service files.
    Note: If you have installed APM in the default location, you can locate the folder in C:\Program Files\Meridium\ApplicationServer\policy-execution.
  2. Access the appsettings.json file in an application that can be used to modify JSON files (for example, Notepad++).
  3. In the file, locate the following text:
    "triggerMessageSettings": {
        "concurrencyLimit": 8,
    	    "retries": 5,
    	    "redeliveryAttempts": 3,
    	    "redeliveryMinInterval": 1,
    	    "redeliveryMaxInterval": 2440,
    	    "redeliveryDelta": 5
    	  },
    	  "executionMessageSettings": {
    	    "concurrencyLimit": 8,
    	    "retries": 5,
    	    "redeliveryAttempts": 3,
    	    "redeliveryMinInterval": 1,
    	    "redeliveryMaxInterval": 2440,
    	    "redeliveryDelta": 5
    	  }
  4. Update the key values as desired.
  5. Save and close the file.
    The updated settings will be applied when the Meridium Policy Execution service is stopped and restarted.

Configure Queue Settings for Policy Trigger Service

About This Task

The Policy Trigger Service processes messages from queues, which are managed by ActiveMQ. The Policy Execution Service provides the following queue configuration options:
  • Retries
  • Redelivery attempts and interval
  • Concurrency limit
  • Duplicate Measurement Location reading trigger elimination timeout

Procedure

  1. On the APM Server, access the folder that contains the Policy Trigger Service files.
    Note: If you have installed APM in the default location, you can locate the folder in C:\Program Files\Meridium\ApplicationServer\policy-trigger.
  2. Access the appsettings.json file in an application that can be used to modify JSON files (for example, Notepad++).
  3. In the file, locate the following text:
    "DuplicateTriggerTimeout": 5000,
      
    "notificationMessageSettings": {
    	"concurrencyLimit": 16,
    	"retries": 10,
        "redeliveryAttempts": 3,
        "redeliveryMinInterval": 1,
        "redeliveryMaxInterval": 2440,
        "redeliveryDelta": 5
      }
  4. Update the key values as desired.
  5. Save and close the file.
    The updated settings will be applied when the Meridium Policy Trigger service is stopped and restarted.

Configure the Time Limit for Policy Execution

About This Task

The Policy Execution Service limits the amount of time allocated to execute each policy instance. This ensures that the Policy Execution Service queue is not backlogged when a poorly designed policy takes too long to execute. If a policy execution is canceled as a result of the time limit, an error message appears in the policy execution history indicating that the time limit was exceeded. By default, the policy execution time limit is set to 15 minutes per policy instance. The minimum time limit is 1 minute, and the maximum time limit is 1 hour. This topic describes how to modify the Policy Execution Service configuration to change the time limit for policy execution.

Procedure

  1. On the APM Server, access the folder that contains the Policy Execution Service files.
    Note: If you have installed APM in the default location, you can locate the folder in the following directory:

    C:\Program Files\Meridium\ApplicationServer\policy-execution

  2. Access the appsettings.json file in an application that can be used to modify JSON files (for example, Notepad++).
  3. In the file, locate the following text:
    "PolicyExecutionTimeoutMs": 900000
  4. Replace 900000 with the time limit value in milliseconds, that you want to apply to policy executions.
    Note: The value you enter should be between the minimum time limit of 60000 milliseconds (that is, 1 minute) and the maximum time limit of 3600000 milliseconds (that is, 1 hour).
  5. Save and close the file.
    The modified settings are applied when the Policy Execution Service is restarted. If the execution time of a policy instance exceeds the time limit that you have specified, the execution is canceled, and an error message is added to the policy execution history.
  6. On the APM Server, access the folder that contains the Meridium configuration files.
    Note: If you have installed APM in the default location, you can locate the folder in the following directory:

    C:\Program Files\Meridium

  7. Go to C:\Program Files\Meridium\ApplicationServer\api.
  8. Access the appsettings file in an application that can be used to modify JSON files (for example, Notepad++).
  9. Repeat steps 3 through 5.
    The modified settings are applied when Meridium Policy Execution service is stopped and restarted on each policy execution server and IIS is reset on the APM Server.

Configure Execution Time Out Value for Math Node

About This Task

If the execution of a Math node in a policy takes a very long time, the execution times out after a pre-defined duration. By default, the execution times out after 1 minute. However, you can configure the interval after which the execution must time out for the Math node.

Procedure

  1. On the Policy Execution Server, go to C:\Program Files\Meridium\ApplicationServer\policy-execution.
  2. Access the appsettings.json file in an application that can be used to modify JSON files (for example, Notepad++).
  3. In the file, locate the following text:
    "MathNodeExecutionTimeout": 60000
  4. Replace 60000 with the interval value in milliseconds at which the execution of the Math node must time out.
  5. Save and close the file.
  6. On the APM Server, go to C:\Program Files\Meridium\ApplicationServer\api.
  7. Access the appsettings file in an application that can be used to modify JSON files (for example, Notepad++).
  8. Repeat steps 3 through 5.
    The updated settings will be applied when the Policy Execution Service is stopped and restarted on the Policy Execution Server and IIS is reset on the APM Server.

Configure the Default Historical Readings Time Range for the OT Connect Tag node

About This Task

During policy execution, if a specific time range to retrieve the historical data for the OT Connect Tag node cannot be determined. For example, if there is no collection filter applied to the Historical Readings output from the node, by default, two years of data will be added. However, you can change the default time range by modifying the settings on the Policy Execution Server and APM Server.

Procedure

  1. On the Policy Execution Server, go to C:\Program Files\Meridium\ApplicationServer\policy-execution.
  2. Access the appsettings.json file in an application that can be used to modify JSON files (for example; Notepad++).
  3. In the file, locate the following text:
    "DefaultHdaTimeRangeYrs": 2
  4. Replace 2 with the number of years for which you want to retrieve the historical data of the OT Connect Tag node.
  5. On the APM Server, go to C:\Program Files\Meridium\ApplicationServer\api.
  6. Access the appsettings.json file in an application that can be used to modify JSON files (for example, Notepad++).
  7. Repeat steps 3 through 5.
    The updated settings will be applied when the Policy Execution Service is restarted on the Policy Execution Server and IIS is reset on the APM Server.

Configure Alternative Query for the Policy Designer Overview Page

About This Task

To optimize the performance of the Policy Designer Overview page in the systems with a large volume of policy execution history records, the Policies tab displays a simplified view which does not display the latest policy execution results. If you want to see the latest results in the Policies list, you can configure the Policy Designer Overview page to use the alternative query (Policy Overview – Policies Alternate Query) that is provided in the APM Catalog.
Note: When you configure an alternative query for Policy Designer Overview page, you might face some performance issues.

Procedure

  1. Access APM using the super user account.
  2. Access the Catalog page.
  3. In the Catalog section, select Public > Meridium > Modules > Policy Manager > Queries.
    The Queries workspace appears, displaying the catalog items of the Queries folder in a table.
  4. Select the check box corresponding to the Policy Overview – Policies query.
  5. In the same row, select .
    The Catalog Item Properties window appears, displaying the properties of the Policy Overview – Policies query.
  6. In the Name box, modify the value to rename the query.
  7. Select Done.
    The Policy Overview – Policies query is renamed.
  8. Select the check box corresponding to the alternative query (Policy Overview – Policies Alternate Query).
  9. In the same row, select .
    The Catalog Item Properties window appears, displaying the properties of the alternative query.
  10. In the Name box, delete the existing value, and then enter Policy Overview – Policies.
  11. Select Done.
    The alternative query is configured for the Policy Designer Overview page.

Configure the SubPolicy Node for Policy Execution

About This Task

If the policies contain recursive sub policies in them, the policy does not execute. If the sub policy nesting is more than 10 levels, the policy does not get executed. This topic describes how to modify the Policy Execution Service configuration to change the recursion limit for policy execution.

.

Procedure

  1. On the APM Server, access the folder that contains the Policy Execution Service files.
    Note: If you have installed APM in the default location, you can locate the folder in the following directory:

    C:\Program Files\Meridium\ApplicationServer\policy-execution

  2. Access the appsettings.json file in an application that can be used to modify JSON files (for example, Notepad++).
  3. In the file, locate the following text:
    "MaxSubPolicyDepth": 10
  4. Replace 10 with the MaxSubPolicyDepth that you want to apply to policy executions.
  5. Save and close the file.
    The modified settings are applied when the Policy Execution Service is restarted. If the execution of a sub policy instance exceeds 10, the execution is canceled, and an error message is added to the execution log and execution history.
  6. On the APM Server, access the folder that contains the Meridium configuration files.
    Note: If you have installed APM in the default location, you can locate the folder in the following directory:

    C:\Program Files\Meridium

  7. Go to C:\Program Files\Meridium\ApplicationServer\api.
  8. Access the appsettings file in an application that can be used to modify JSON files (for example, Notepad++).
  9. Repeat steps 3 through 5.
    The modified settings are applied when Meridium Policy Execution service is stopped and restarted on each policy execution server and IIS is reset on the APM Server.

Configure Policy Reference Clean Up Batch Size

About This Task

When policies and policy instances are inserted, modified or deleted, this may result in changes to very large numbers of related records. In order to optimize the performance for the end user, the related record clean-up is completed in batches by a background task. You can configure the batch size and the frequency for this task. The batch size must be less than 1000 in order to avoid database table locks.

Procedure

  1. On the APM Server, access the folder that contains the Policy Execution Service files.
    Note: If you have installed APM in the default location, you can locate the folder in C:\Program Files\Meridium\ApplicationServer\policy-execution.
  2. Access the appsettings.json file in an application that can be used to modify JSON files (for example, Notepad++).
  3. In the file, locate the following text:
    
        "PolicyRefCleanupBatchSize": 500,
        "PolicyRefCleanUpFreqSeconds": 15,
        
  4. Update the key values as desired.
  5. Save and close the file.
    The updated settings will be applied when the Meridium Policy Execution service is stopped and restarted.