Create a Rule
A Custom Diagnostic Rule may be created to monitor specific tags for thresholds or trends that may indicate an associated event or condition. This is accomplished on the Rules Administration page by clicking the Create Rule button and then following the step-by-step instructions on the New Rule page.
- Click the Create Rule button.
- The New Rule page will be displayed and is ready for data entry starting with the 1: Rule Type tab.
Step 1: Rule Type tab
On the 1: Rule Type tab, enter values in the following fields:
- Rule Type - When creating a new Custom Diagnostic Rule, the only available option is already pre-selected (i.e., Custom Diagnostic Rule).
- Rule Description - The user may enter an optional description of the rule such as its intended purpose, the field conditions or events it is trying to detect, the devices or wells being monitored, etc. This description will be displayed in the Apply Rule page when a Custom Diagnostic Rule is selected as the Rule Type.
- TIP: It is recommended to provide a description that makes it apparent how this rule should be used. This will allow other users to easily understand and determine whether this existing rule can meet their needs. It also promotes good rule stewardship to avoid creating numerous rules that are identical or highly similar.
Once the Rule Type and Description information has been entered then the user may proceed to the 2: Rule Logic tab by clicking the Rule Logic button in the bottom right of the page.
Step 2: Rule Logic tab
The 2: Rule Logic tab is used to specify the tags and conditions that the rule will use to determine when an event starts and ends. The top portion of the page contains the Rule Logic Event Start section where start and end conditions are configured for each tag. The bottom portion of the page contains the Rule Logic Description section which automatically generates easy-to-understand language as each rule condition is built.
Rule Logic Event Start
Each rule may have one or more conditions defined, and each condition may have one or more tags defined with associated value expressions. This section will describe each of these scenarios including:
- Define a single condition
- Define a nested condition
- Define a new condition
Define a Single Condition
Single rule conditions may be defined by selecting a single Tag and then selecting the associated function, duration, operator and value to define the expression. The steps to define the rule logic for when an event starts are as follows:
- Tag (required) - Select the tag to be used in the rule condition (e.g., Casing Pressure).
- Tag Value (required) - Select whether the rule condition should evaluate the last known value of the tag or use an aggregate function value over time.
- Available values include Last Known Value, Maximum value, Minimum value, or Average value.
- The default value is Last Known Value.
- If one of the aggregate functions are selected then the two Duration fields will also be displayed to capture the duration of time to be used by the function.
- Duration Value (required with aggregate functions) - Enter the numeric value to indicate the number of minutes or hours as indicated by the selected Duration Unit of Measure value.
- Duration Unit of Measure (required with aggregate functions) - Select the time unit of measure to use when comparing aggregate function values.
- Available values include Hours or Minutes.
- The default value is Hours.
- Operator (required) - Select the expression operator to use when comparing the tag value against the rule Condition Value.
- Available values include Equal to, Not Equal to, Less than, Greater than, Less than or equal to, Greater than or equal to or Between.
- Default value is Less than.
- Condition Value (required) - Enter the numeric value against which the rule Tag, Tag Value, Duration and Operators will be evaluated.
- This value is the last component of the Condition.
Define a Nested Condition
A Nested Condition is similar to a Single Condition except that two or more Tags are selected and condition logic is defined for each one. Further, the selected Tag conditions may be evaluated together using an AND operator, or separately using an OR operator.
To create a Nested Condition:
- Click the + Nested Condition button in the Rule Logic Event Start section. A new embedded row will be added to the current condition and a set of fields will be displayed awaiting data entry by the user.
- Click the AND/OR drop-down located above the new Nested Condition fields to indicate whether to evaluate the two selected Tags together (i.e., AND) or independently (i.e., OR).
- The AND value indicates that all of the selected Tag expressions must evaluate to TRUE to determine if an Event has started.
- The OR value indicates that any of the selected Tag expressions must evaluate to TRUE to determine if an Event has started.
- Enter values in the Nested Condition fields using the same procedures as described in the Define a Single Condition section above.
Define a New Condition
In addition to a Single Condition and/or Nested Condition(s), New Conditions may also be created which may be evaluated together using an AND operator or independently using an OR operator. This provides flexibility to create more complex rules where multiple Single Conditions and/or Nested Conditions may be used together.
To create one or more New Conditions:
- Click the + New Condition button in the Rule Logic Event Start section. A new separate Single Condition section will be created and a set of fields will be displayed awaiting data entry by the user.
- Click the AND/OR drop-down located between the two Condition sections fields to indicate whether to evaluate the two Conditions together (i.e., AND) or independently (i.e., OR).
- The AND value indicates that all of the Conditions must evaluate to TRUE to determine if an Event has started.
- The OR value indicates that any of the Conditions must evaluate to TRUE to determine if an Event has started.
- Enter values in the New Condition fields and/or create Nested Conditions using the same procedures as described in the Define a Single Condition and Define a Nested Condition section above, respectively.
Rule Logic Event End
By default, newly created rules are configured to use the same logic both to mark the start of an event (i.e., when the condition(s) are met) and to mark the end of an event (i.e., when the conditions are no longer met). This is indicated under the Rule Logic Event End section by the End the event when the conditions from Rule Logic Event Start return to normal checkbox. This value is checked by default.
If the user is comfortable using the same rule logic for the start and end event thresholds then no further changes are necessary. The user may proceed to the Rule Logic Description section and/or click the Simulation button to move to the next tab.
Optionally, separate rules and conditions may be configured to clear the event as follows:
- Uncheck the checkbox titled End the event when the conditions from Rule Logic Event Start return to normal. This will cause a set of Single Condition fields to appear to define the rule condition logic including the Tag, Tag Value, Duration and Operators.
- Enter values in the Single Condition fields and/or create Nested Conditions using the same procedures as described in the Define a Single Condition and Define a Nested Condition section above, respectively.
Once all fields have been completed in the Rule Logic Event Start and Rule Logic Event End sections then the user may proceed to the Rule Logic Description section and/or click the Simulation button to move to the next tab.
Rule Logic Description
The Rule Logic Description section automatically generates user-friendly readable text that describes the logic of the rule condition logic configured in the Rule Logic Event Start and Rule Logic Event End sections above. This content is for review purposes only and provides the user an opportunity to review the rules in easy to understand terms to ensure it is accomplishing the intended result.
This content cannot be modified or changed directly. If changes are needed then the changes need to be applied to the respective rule condition logic in the Rule Logic Event Start and Rule Logic Event End sections above.
Once all fields have been completed in the Rule Logic Event Start and Rule Logic Event End sections and the user has reviewed the Rule Logic Description section then the user is ready to click the Simulation button to move to the next tab.
Clear All button
The Clear All button may be clicked by the user at any time to remove any and all conditions and values. This will effectively reset the page and allow the user to begin reconstructing the rule condition logic as described in the Define a Single Condition section above.
The Advanced button is visible and usable only by eLynx internal Support team personnel. It is used to directly enter code into the rule logic conditions to implement complex formulas such multi-tag comparisons and calculating trends or slopes over customized periods. The instructions for using the Advanced button are contained in a separate article.
Rule Type button
The <-- Rule Type button is used to return to the 1: Rule Type tab to modify the Rule Type or Rule Description. Any values entered in the 2: Rule Logic tab will be preserved for the user to continue the Create Rule action.
The Cancel button abandons the Create Rule action. The user will be prompted to confirm they wish to cancel and, if they respond affirmatively, then the system will discard all changes made on the Create Rule tabs and will return the user to the Rules Administration page.
The Simulation --> button is used to continue with the Create Rule action using the specified Rule Logic condition values. This will display the next step in the process on the 3: Simulation tab.
Step 3: Simulation tab
The Simulation tab allows for testing the logic and thresholds by passing data from a selected object over a specified timeframe to the Rules Engine. The Rules Engine will will evaluate the data for the rules and return a graph with the source data and highlighting the areas in violation of the Rule Logic.
1) To run a Simulation first select the object (well or device) by clicking the Select Object button in the upper left corner.
This will pop up an object selector as shown below.
Only objects that are in the current Group that have all the tags required by the Rule Logic will be shown. Select any one device from the list then click the Select button to proceed.
2) Set the Start Time for the data to be used for the simulation.
3) Set the End Time for the data to be used for the simulation.
4) Click the Simulate button.
The Rules Engine will begin to process the data. Please be patient, depending on the complexity of the Rule and the timespan selected this can take some time to process. A Progress Indicator will be shown while the Rule is being evaluated.
Once the processing has completed you will be presented with a graphical representation of the results. A pop up will also tell you how many violations occurred in the time period.
Note the "info" markers near the left edge of the graph, those indicate the time periods in violation.
After you close the Simulation Results pop up you can zoom in on sections of the graph, as you can see below the markers now expand and highlight the full timeframe of the individual violations. Click the Reset Zoom button to restore the view of the full dataset.
Note that the Rule Logic section at the bottom allows you to alter the thresholds and re-run the simulation if you would like to adjust the sensitivity of the Rule.
How to store and reuse simulations (eLynx Admin use only)
Each time a simulation is run a unique number is generated and displayed in the Session ID field. This number can be retrieved and used by eLynx Admins to quickly reload and re-run a simulation using the Rule Logic parameter values associated with that Session ID.
1) In the Session ID field, enter the Session ID number.
2) Click the Load Simulation button to retrieve the Rule Logic parameter values associated with the Session ID and populate them in the respective fields in the Rule Logic section.
Once you are pleased with the simulation results click the Summary button to proceed to the Summary tab where you can review the Rule Logic and save the new Rule.
Step 4: Summary tab
The Summary tab displays a text description of the Rule and allows for a final review before saving the new Rule to the system.
When you are ready simply click the Save As New button to save the Rule Logic to the system.