Examples of Validation Rules

Scenario 1: Report Gas Consumption

Let's say an activity contains information about gas consumption. There are three of types of consumption: predicted, actual, and removed. The 'predicted' amount of consumed gas is saved in the activity. When a Mobile Worker chooses to report the actual information about the consumed gas, then the difference between 'actual' and 'predicted' data must be calculated automatically. If the actual consumption exceeds the predicted consumption by more than 20 cubic meters and the conditions of the gas counter are good, then the 'Reporting notes' property is displayed.

Prerequisites: Let us assume that 'Predicted gas consumption', 'Actual gas consumption', 'Difference', 'Counter is not broken' and 'Reporting notes' string-type properties are configured in the application. And, there is the 'Counter is not broken' integer property with a check box on the GUI.

Configuration: Configure the expressions in the 'Default' field for the 'Difference' property. For example: activity.real_consumption-activity.predicted_consumption

Visibility: Set the visibility for 'Reporting notes' as Read/Write with the same formula as the condition: (activity.real_consumption-activity.predicted_consumption) >20 AND activity.counter_conditions=1

Scenario 2: Checking Ratio

A Mobile Worker has to enter the Upstream Signal-to-Noise ratio to complete an activity (it is mandatory). The range must not be seen and it has to be anywhere between +32 to 52 dBmV. When the Mobile Worker enters a value of 55dBmV, which is not in the range then the Mobile Worker must know that is not the range and has to try again. The Mobile Worker measures again and enters 51dBmV, which is in the range allowing to complete the activity.

Prerequisites: Let's assume that the Upstream Signal-to-Noise' property is configured in the application. The 'Upstream Signal-to-Noise' property is configured on the 'Complete activity' page as mandatory.

Configuration: Configure the expression in the 'Validation' field for the 'Upstream Signal-to-Noise' property. For example: this BETWEEN (32,52).

Configure the custom error message in the corresponding field to be displayed to the techician.