Minimum and maximum values

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Process wizard > Define Forms > Form Controls > Controls properties >

Minimum and maximum values

It is a common requirement to validate a numeric input against a minimum and/or maximum value; specifically, in Bizagi, for the Number, Money or Date controls.
To accommodate this need, Bizagi provides Minimum and Maximum properties.

 

The Minimum and Maximum value properties are found in the Advanced tab of the control's Properties.

 

For these properties, the values can be set by entering text, selecting a value or associating an expression. The value, set by any of these methods, will display in the property's description area.

 

MinimumandMaximumValue6

 

If the end user input does not fall within the range of minimum and maximum boundary values, a validation will display.

 

note_pin

If you are using an expression, its name will be displayed on the left. If the name is too long to fit in the box, hover with the mouse, a tooltip with the complete name will display.

Controls Properties27

 

Example:  Define minimum and maximum boundary values for a Money Control

In a Credit Request Process the amount to be requested must be at least a 100 US dollars. Also, the maximum amount allowed is ten times the monthly income of the applicant.

 

In the Credit Request Process Entity, the Monthly income and the Requested Amount property values are stored in the attributes with the same name.

 

MinimumandMaximumValue5

 

 

1. In the Forms Designer, go to the Requested Amount control Properties and open the Advanced tab.

 

MinimumandMaximumValue1

 

2. In the Minimum property type the value of 100.

 

MinimumandMaximumValue2

 

 

3. Select the Maximum property and click the expression icon (Forms Components151) in order to associate an expression.

 

MinimumandMaximumValue3

 

 

4. In the expression module define the maximum threshold based on the monthly income.

 

The expression in this example would be: <CreditRequest.MonthlyIncome>*10;

 

MinimumandMaximumValue4

 

Save the expression and close the Form.

 

5. Proceed to test your validations in the Work Portal.

Enter a value lower than a 100 in the Requested Amount Control. When clicking Next, a validation message will display, as shown in the image below.

 

MinimumandMaximumValue7

 

 

Now enter a value higher than ten times the monthly income of the applicant. When clicking Next, the following message will display as shown in the image below.

 

MinimumandMaximumValue15

 

 

 

Example: Define minimum and maximum boundary values for the Date Control

In a Vacation Leave Request Process an employee must request the vacations at least 15 days in advance. In addition, a stipulation exist whereby requests submitted after December 30th (2012) will not be processed.

 

The official working day on which the vacation commences is stored in the attribute Leaving Date, within the Vacation Request Process Entity.

 

MinimumandMaximumValue12

 

1. In the Forms Designer, select the Properties of the Leaving Date control and open the Advanced tab.

 

MinimumandMaximumValue8

 

 

2. In the Maximum property select the December 30th entry from the calender.

 

MinimumandMaximumValue9

 

 

3.  Select the Minimum property and click the expression icon (Forms Components151) in order to associate an expression.

 

MinimumandMaximumValue10

 

 

4. In the expression module define the minimum value allowed (15 days in advance) according to the current date.

 

The expression in this example would be:

 

var Today=DateTime.Today;

var Max=Today.AddDays(15)

Max;

 

MinimumandMaximumValue11

 

Save the expression and close the form.

 

5. Go to the Work Portal to test the validations. Try to enter a date after December 30th. Note that this cannot be done as all days that fall after the boundary date are disabled (in this example the 31st). In addition, the next month icon (Forms Components153) is disabled.

 

MinimumandMaximumValue13

 

 

Now try to enter a date between today and two weeks thereafter (suppose the current day is 5/05/2016). Again, note it is not possible.

 

 

MinimumandMaximumValue14

 

Related Articles

Minimum value using expressions

Maximum value using expressions