Obtain Boolean value

<< Click to Display Table of Contents >>

Navigation:  Low-code Process Automation > Studio Cloud - Authoring environment > Bizagi Studio > Process wizard > Business Rules > Business Rules examples > Math operations, strings and data validations >

Obtain Boolean value

Overview

Bizagi offers a function where you can obtain the Boolean value of a parameter. It returns true if the parameter equals 1 or true. The function is as follows:

 

CHelper.getBoolean(value)

 

The following attribute is needed:

Value: String to be evaluated.

 

This function is useful when you have string-like controls, where you need users to type-in an answer.

 

Example

In the following example, Office Supply Request, the request is approved by an external system, the response must be stored in the attribute Approved of the Product Request entity.

 

ProductRequestDataModel

 

The response will come as 1 if the request is approved and 0 if not. To store this value in our Boolean attribute, we will store it in the sApproved parameter and then transform it into a Boolean value like this:

 

getBoolean_01

 

The code in the image above is as follows:

<OfficeSupplyRequest.ProductRequest.Approved> = CHelper.getBoolean(sApproved);


Last Updated 1/6/2022 4:18:33 PM