ISEMPTY

This post is referring to Vahana 2 (beta version). To check the document for production, please go to vDesigner-v1.0

You can use the ISEMPTY function to check if an element, attribute, system variable, or other object type contains no value or is empty. If the ISEMPTY function finds that an element, attribute, system variable, or other object type is empty, it returns the true Boolean value. If the ISEMPTY function finds that an element, attribute, system variable, or other object type contains a value, it returns the false Boolean value.

You can use the ISEMPTY function to apply a validation to mandatory fields. This validation checks if the user selected the element or entered the value in the element. To implement this functional scenario, assume you have an application page.

On this application page, you have a Name input field and an ADD push button, in addition to other input fields.

If the user does not enter a value in the Name input field and performs the next function, or clicks the Add button, the application must display an error message to the user. The following section describes how to implement the ISNULLOREMPTY function to check the value in the element.

Implementing ISEMPTY Function in Business Rule

First, you need to create a business rule. In the business rule, you will define a condition. In the condition, you will use the ISEMPTY function. When the user performs the function, the application checks if the user’s action satisfied or did not satisfy the condition in the business rule. Based on the user’s action, the ISEMPTY function either returns the true Boolean value or the false Boolean value.

To implement ISEMPTY function:

  1. On the vDesigner module’s dashboard, see the left navigation panel.
  1. Put the mouse pointer on the left panel to expand it.
  2. In the left panel, click Business Rules to display the Business Rules page.
  3. On the Business Rules page, click Create Business Rule to display the Create New page.
  4. On the Create New page, in the middle panel, in the Name box, enter the new business rule’s name (for example, Check Empty).
  5. In the right panel, see the IF block.
  6. Under the IF block, click in the When box to display the Search box.
  7. In the Search box, scroll right through the list of tabs and then click the Functions tab.
  1. After you click the Functions tab, enter static in the Search box to display the Static function.
  1. In the list, click the Static function to display it with the value and String parameters.
  2. In the Static function, click the value parameter and then enter true in the place of the value parameter.
  1. In the Static function, click the second (for instance, String CastTo) parameter and then click Boolean in the context menu to select it.
  1. After you click Boolean, the When box displays the Static function with true and Boolean as parametric values.
  2. In the IF block, click the middle box, and then select the equal to (==) operator to compare two conditions in the business rule.
  1. Click in the right box to display the Search box.
  2. Under the Search box, scroll right through different tabs and then click the Functions tab.
  1. After you click the Functions tab, enter isempty in the Search box to display the ISEMPTY function.
  2. In the list, select the ISEMPTY function.
  3. In the ISEMPTY function, click the path parameter to display the Search box.
  4. Under the Search box, click the Element tab.
  1. Click in the Search box, and then enter the reference name (for example, InputField_Name) of the element to check the value in it.
  1. After you enter the reference name (for example, InputField_Name) of the element, the list displays the element’s reference name.
  2. In the list, select the element’s reference name to define the second expression in the business rule.
  1. Click Create to successfully create and configure the business rule.

Configuring a Task Group

After you create a business rule and define the condition to check if the user entered the name in the Name field, you need to configure a task in the task group. This configured task will display an error message if the user does not enter the name in the Name field, which automatically satisfies the condition in the business rule.

To configure a task group:

  1. On the vDesigner module’s dashboard, see the left navigation panel.
  1. Put the mouse pointer on the left panel to expand it.
  2. In the left panel, click Task Groups to display the Task Groups page.
  3. On the Task Groups page, either click Create Task Group to create a new task group or double-click the name (for example, Chk_Empty_Tskgp) of the existing task group to open the <<task group name >> page.

Note:- To know more about creating a new task group, click here.

  1. On the <<task group name >> page, in the Task tab, search and find the Display Message task.
  2. After you find the Display Message task, drag it to the Execution panel.
  1. Under Display Message, in the Select Message box, click the application tree icon () to display the Message Library panel.
  2. In the Message Library panel, either click Create New to create a new message or click the existing message to select it.

Note:- To create and configure a new message, see the post, Creating a New Message.

  1. After you select the message, click Select to map it to the Display Message task.
  1. In the Business Rule box, click the application tree icon () to display the Business Rules panel.
  2. In the Business Rules panel, search and find the business rule to map it to the Display Message task.
  1. After you find the business rule, click it and then click Select to map it to the Display Message task.
  1. After you successfully map the message and business rule to the Display Message task, click Save in the right panel to configure the Display Message task in the Chk_Empty_Tskgp task group.

After you configure the Display Message task in the task group, you can link the task group to the Add button on the application page.

Linking Task Group to Add Button

After you implement the ISEMPTY() function in the business rule and map the business rule to the Display Message task in the Chk_Empty_Tskgp task group, you need to link the task group to the Add button.

After you link the Chk_Empty_Tskgp task group to the Add button, you successfully apply the ISEMPTY() function to check and validate the value in the Name field.

If the end user enters his or her name in the Name field and then clicks the Add button, the ISEMPTY() function returns the false Boolean value. As a result of this user action, the application will not display the error message to the user.

If the end user does not enter his or her name in the Name field and then clicks the Add button, the ISEMPTY() function returns the true Boolean value. As a result of this user action, the application will display the error message to the user.

To link the task group to the Add button:

  1. On the vDesigner module’s dashboard, on the related application page, find the element (for example, Add button) to link it to the Chk_Empty_Tskgp task group.
  2. Click the element (for example, Add button) to display its property panel.
  1. In the Button panel, click the Events icon () to display the list of events.
  2. In the list of events, find the onClick event.
  3. To the right of the onClick event, click the plus icon () to display the Event Configuration page.
  4. On the Event Configuration page, in the Task Group panel, search and find the task group (for example, Chk_Empty_Tskgp).
  1. After you find the task group (for example, Chk_Empty_Tskgp), drag it to the Execution panel.
  2. After you drag the task group to the Execution panel, it displays the task or the list of tasks that you configured in the task group.
  1. In the right panel, click Save to link the task group to the Add button.

The End Result

Case1:- If the end user enters his or her name in the Name field and then clicks the Add button, the ISEMPTY() function returns the false Boolean value. As a result of this user action, the application will not display the error message to the user.

Case2:- If the end user does not enter his or her name in the Name field and then clicks the Add button, the ISEMPTY() function returns the true Boolean value. As a result of this user action, the application will display the error message to the user.

Note: This post described linking the task group to the onClick event of the Add button. If you want the ISEMPTY function to check and validate the value when the end user enters it in the Name input field, you can link the task group to the onCompletion event of the Name input field. In this case, the ISEMPTY function will validate the value after the end user enters it in the Name input field.

Was this article helpful?
YesNo