Categories
#Activities #Data in DCR Process Models #DCR Form

Adding data to activities

Data was introduced in DCR Forms in 2016. It has been possible to associate data with activities for a long time, but it has not been possible to specify data types or simulate processes that contains data types, e.g. in order to make decisions.

Datatypes

It is possible to associate a datatype with an activity. In the options panel under Advanced select Data Type:

Valid datatypes are:

NameCode
Button
Boolean
Checkbox
Choice
Date
Datetime
Duration
Email address
File
Float
HTML
Image file
Integer
Label
Money
Password
Text
Textbox
Weblink

A simple example of data in DCR

Please look at this process for a simple example of making a decision in a process illustrated below:

DCR Process with data

Notice the event “Decision”. It is a data event illustrated by the box in the upper right corner of the event. The data type in selected in the Option panel under Advanced

Setting the data type

The Decision event has two values, 1 as “Yes” and 0 as “No” as illustrated below. Note that the datatype of choice is integers, unless you select it to be a string using the "Data Type" field below the choice field. If you use strings as the datatype remember to quote string values in guards.

Setting the data type

When simulating an event with a data type cannot be executed directly as the user has to enter a value. Instead, the simulator will present the user for the value to be filled out using a DCR Form.

Data event in task list

Clicking “Open” will launch a DCR Form where the decision can be made.

Data event filled out in DCR Form
The log shows the value of data activities once executed.

Once data is filled out and form is submitted pressing Send button the guards on the include/exclude rules will use Decision=1 (Yes) to show the next step.

Tasks list after choosing Yes

Using guards in business rules

Business rules can be guarded, i.e. controlled by an expression. If the expression evaluates to true the rule is included in the calculation of semantics, whereas if the expression evautes to false it is the same as the rule does not exist at all.

The include and exclude rules below are both guarded by an expression, i.e. “Decision=1” and “Decision!=1”. If Decision=1 include is then only relevant rule as the guard “Decision!=1” evaluates to false and therefore is not relevant for the process.

Using guards

We’re planning to define a new meta-rule called a logical include which will act as an include if it evaluates to true and as an exclude if it evaluates to false.

DCR use an expression language which is defined on git.

Grouping data events into a DCR Form

Several data events can be grouped together and the grouping marked as a DCR Form

Setting Type to Form

Once events as grouped into the form object it will display green with the events inside.

Grouping events into a DCR Form

When the user click Open the following form is shown

Events grouped into a DCR Form

Boolean or a checkbox

In any form a field might not yet have a value. This typically happens when the user opens the form. A boolean therefore have three values, no value, true or false. Obviously this confuses many people but we need to represent these three different values as they occur in the form.

A checkbox therefore have two values, true or no value (null).

If you need a boolean field with true or false, it will have three potential values, true, false or no value (null)

We have outlined the difference between a boolean and a checkbox below:

Visit the boolean example found to experiment yourself.

Related Release notes

Portal 7.3.0

  • Custom effect administration
  • Welcome organization administration
  • DMN hit policies

Related Videos

Related Examples

Related Articles