Return Value

<< Click to Display Table of Contents >>

Navigation:  Low-code Process Automation > Studio Cloud - Authoring environment > Bizagi Studio > Process wizard > Business Rules > Business rules elements >

Return Value

Overview

As mentioned in previous articles, Citizen Developers cannot edit nor create scripting expressions. In some scenarios, these expressions must return a value or an element. For this reason, the return value option is available for the Citizen Developers to fulfill this requirement. This article explains how to use the return value option.

 

What you need to do

The return value option is used when an expression needs to hand back an element or a value, for example, an expression can return the minimum value or the default date of an attribute. To use this feature, go to the expression that will return the value, or create one. Then right-click it to add a new step and select Add return.

 

BusinessRulesReturn1

 

A window appears for you to enter the description of the return step.

 

BusinessRulesReturn2

 

With this the return step is created and now needs to be configured, to do so double click it or right-click it and select Properties.

 

BusinessRulesReturn3

 

The configuration window appears.

 

BusinessRulesReturn4

 

There are three types of return values that can be configured:

 

Function: defines the result of a function as the return value of the expression, for example, the Today function.

 

BusinessRulesReturn5

 

Only functions with a return value are available.

 

Variable: assigns a previously created variable as the return value of the expression. Remember that the variables are declared in the first step of the expression (right-click the start and select Variable Declaration)

 

BusinessRulesReturn6

 

Xpath: defines an element of the data model with its corresponding xpath as the return value of the expression.

 

BusinessRulesReturn7

 

The elements available for return depend on the context of the expression. For example, if the expression is located inside a collection's add form, the elements available belong to the data model of the process entity related to the collection.

 

BusinessRulesReturn7a

 

note_pin

Keep in mind that the type of value returned in the expression must coincide with the type of value that the control manages (e.g dates with dates, integer with integer). If they are different, errors may occur in the execution of the form.

 

Considerations

Do not use

We recommend to avoid using the Return Value to define default values of columns within tables (collections within forms). Citizen Developers can request the help of a Developer user to include an scripting expression to define such values.

 

Behavior

In scenarios where there are multiple return values, or steps after the return value, the expression behavior will depend on if it is a Library rule or not.

 

Library rules

In this case, the return value is the first one in the expression flow, any other steps in the expression after the return value are ignored.

 

BusinessRulesReturn8

 

Other expressions

In this case, the return value is the last one in the expression flow, all the steps in the expression are performed.

 

BusinessRulesReturn9

 


Last Updated 7/5/2023 11:01:06 AM