Obtain Boolean value

<< Click to Display Table of Contents >>

Navigation:  Bizagi Studio > Process wizard > Business Rules > Business rules examples >

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);