Basic Actions

<< Click to Display Table of Contents >>

Navigation:  Low-code Process Automation > Studio Cloud - Authoring environment > Bizagi Studio > Process wizard > Define Forms > Customizing controls behavior > Actions and Validations > Actions components >

Basic Actions

In the next examples we will illustrate how to define basic actions.

 

Hide or show one control based on one condition

Make several controls mandatory and visible based on one condition (including controls one by one)

Make several controls mandatory and visible based on one condition (using Panel - recommended)

Change the format of a control based on compound conditions (using AND)

Make a control editable or read-only

 

note_pin

We strongly suggest that if you choose to use Actions to control visibility, all visibility definitions must be done with actions.

Beware that combining visibility Actions with visibility Expressions will most likely fail in runtime.

 

Hide or show one control based on one condition

In a Vacations request process, we would like to display the control Leaving Date if Request Vacation is true.

We will hide the control Leaving Date if Request Vacation is false or not selected.

 

Action0

 

1. Create the action.

On the Forms designer, select Actions & Validations and add a new action.

 

Action15

 

2. Include the condition (If). Select the control, operator and value as follows.

Request Vacation is true

 

Action2

 

3. Include the action (Then). Define what will happen when the condition above is met.

change visibility for Leaving Date to Yes

 

Action3

 

4. Define the Else action, that will execute when the condition is NOT met.

change visibility for Leaving Date to No

 

Action4

 

This is how the Work Portal will look like according to the end user's choice:

 

Action5

 

Make several controls mandatory and visible based on one condition - Including controls one by one

In a Vacations request process we would like to make the following controls mandatory and visible if Request Vacations is true:

Leaving Date, Returning Date and Number of business days requested.

We will hide those controls when Request Vacations is false or not selected.

 

Action6

 

1. Create the action.

On the Forms designer, select Actions & Validations and add a new action.

 

Action15

 

2. Include the condition. Select the control, operator and value as follows.

Request Vacation is true

 

Action2a

 

3. Include the action (Then). Define what will happen when the condition above is met.

Add as many actions as you need:

change visibility for Leaving Date, Returning Date and Number of business days requested to Yes

set required for Leaving Date, Returning Date and Number of business days requested to Yes

 

Action7

 

4. Define the Else Action, that will execute when the condition is NOT met.

change visibility for Leaving Date, Returning Date and Number of business days requested to No

Note you don't need to make the controls not required, since they will be hidden.

 

Action8

 

This is how the Work Portal will look like according to the end user's choice:

 

Action9.

 

Make several controls mandatory and visible based on one condition - Using Panel (recommended)

In a Vacations request process we would like to make the following controls mandatory and visible if Request Vacations is true:

Leaving Date, Returning Date and Number of business days requested.

 

You can include controls one by one like in the example above, or you can group them and make a single action. This is recommended: it will save you a lot of time and make the managing of actions a lot easier.

 

1. Include a Panel, dragging and dropping from the Controls area.

Drag and drop the attributes you will affect with your action into the panel.

 

Action12

 

2 Create the action just using the Panel as control. Panel groups the controls contained.

 

Action13

 

This example and the one above have the exact same effect on the Work Portal.

There is no difference on the interface presentation. Panels just make you work easier.

 

Change the format of a control based on compound conditions

In a Vacations request process we would like to change the color of the control Leaving Date to red, if Request Vacation is true AND the Leaving Date is greater than the Returning Date (which makes no sense).

 

1. Create the action.

On the Forms designer, select Actions & Validations and add a new Action.

 

Action15

 

2. Include both conditions in the If section.

 

ActionsandValidations1

 

3. Add the action in the Then section to change the color of the control.

 

ActionsandValidations2

 

4. Add an Else action to return the control to the original state.

 

ActionsandValidations3

 

This is how the Work Portal will look like:

 

ActionsandValidations4

 

Make a control editable or read-only

When being editable or read only, set through actions, the instruction is inherited for the entire set of controls where it they are used. If attributes are contained in a group (such as a reusable form, group, panel), the editable or read-only instruction apply for all of them, regardless of their initial property.

 

There is a Default option in actions that can be used when controls are contained in a group (such a reusable form, group, panel). If the command change editability for is set to default, the original configuration of each control is kept.

 

ManagingUserInterface63

 

Keep in mind that the behavior of the editability of controls contained in groups, reusable forms or panels differs when set on actions than when set using expressions.

In expressions, when it returns true, the controls are editable or read-only according to their initial state.

 

To exemplify, suppose you design a form as follows:

 

Type

Name

Contained on

Boolean

Is active

N/A

Group

User Information

N/A

Attribute

Name

User Information

Attribute

Description

User Information

Attribute

Creation Date

User Information

 

ManagingUserInterface57

 

Now, you define the attribute's name, description, creation date editability properties on the left panel of the form designer as follows:

 

Attribute

Editability

Name

No

Description

Yes

Creation date

No

 

ManagingUserInterface58

 

ManagingUserInterface59

 

ManagingUserInterface60

 

Set an action to configure the editability of the control User Information depending on the boolean control's selection. If the boolean control is false the editability of the control User Information is false.

 

ManagingUserInterface61

 

Consequently, when the activity is executed the attributes contained on the User Information control inherits the parent control editability settings, overlapping the configuration set for each attribute when the form was designed.

 

ManagingUserInterface62

 

To keep the original form settings, so the attribute's editability is kept, set an action to configure the editability of the control User Information. If the boolean control is Default, the editability of the control is kept as it was defined when designing the form.

 

ManagingUserInterface63

 

Consequently when the application is executed, the original settings are kept.

 

ManagingUserInterface64


Last Updated 7/5/2023 8:48:03 AM