If a rule runs for too long or runs too frequently, the Platform may disable it from running again or terminate it before it can adversely affect Platform performance. The Platform monitors executing rules, tracking when a rule starts and ends, how often it runs within a specified timeframe, how long a single rule takes to complete, how long all events spawned from a single rule take to complete, and so on. The Platform administrator has defined acceptable values for each of the rule metrics which, as a whole, define the rule execution policy for the Platform.
Consider an execution policy defining that no more than 5000 rules should run within a 2 minute period. If that threshold (5000) is met, the Platform determines which rule ran most frequently within that period of time and disables it. In the example below, the threshold, set at 5000, was crossed and reached an actual value of 6000 before the Platform disabled the biggest policy offender, a rule that executed 500 times with the monitored time period.
If the Platform disables a rule, it will show it as disabled in the View and manage expression rules page (as above). You can mouse over the violation icon to see a tooltip explaining why it was disabled and the circumstances that led the Platform to disable it. The Platform will create an Audit log message for display in the Asset dashboard of the related asset and in the Administration application. In addition, the Platform sends two notifications: one to the Platform administrator and one to the user who last modified the rule.
If the problem expression rule is configured for a state within a state machine, this icon appears in the Enabled column for the state machine in the View and manage state machines page and in the States pane in the Configure the state machine page.
When a rule is disabled, it will not run automatically (that is, based on its configuration). For example, if the rule is defined to run when the Platform receives an Alarm message, it will not run until it is re-enabled. Before you re-enable the rule, you should review the rule and fix the behavior(s) that caused the Platform to disable it in the first place. To edit the rule, select the violation icon for that rule: the Configure the expression rule page appears.
The notification sent when the Platform disables a rule provides guidelines for making corrections to your rules. Review those actions to determine if one or more of them may help you resolve the issues with the disabled rule, as well as help you design other rules that run effectively and efficiently.
Limit the number of assets associated with the rule - only associate the required assets to a rule; don t associate all assets to your rule.
Limit how often a rule runs - one way to do this is to limit the number of messages entering the Platform to only those necessary to your needs; another way is to ensure the rule will only run when absolutely necessary by carefully designing the If evaluation statement.
Make sure asset associations are used for a reason - ensure that all your asset-asset associations make sense and are truly necessary. The Platform evaluates a message for each associated asset by running all associated rules; any unnecessary asset associations result in additional processing.
Make sure rule actions don't trigger too many additional rules - for example, if an action for a rule causes several more actions to run, and each causes more actions to run, eventually the Platform may disable the rule because the downstream events take too long to process
If the rule runs a groovy script, try to optimize it - try modifying the Custom Object so that it performs only necessary operations.
For a complete reference on developing efficient rules and custom objects, see the Axeda Rules Development Guidelines (PDF).
Note: The Platform administrator has the ability to collect system metrics and statistics and to monitor message and rule activities and traffic. The administrator can tune the Platform to handle varying message traffic and the load put on the Platform from rule execution.