Home / Flowable / Lesson 22

Variables, parent and root scope

Forms, data, security. A free Flowable lesson in simple English (2:27 minutes).

Open in the academy (practice, progress and notes)

Chapters

Lesson text

0:00 What you will learn

Welcome to lesson twenty-two. Variables hold the data of a process or a case. Today we learn where they live, and how to reach them. This topic often appears in exam questions about expressions. This is an independent course. It is not made or approved by Flowable.

0:16 Variables

A variable is a value with a name. For example, the amount is five hundred, or the customer's name is Asha. Variables can be simple values, such as text, numbers and true or false. They can also be structured JSON data. For example, a customer with a name, and an address with a city. JSON data can also contain lists, called arrays. For example, the lines of an invoice.

0:39 Scopes

A case can start a process, and that process can start a subprocess. Together they form a family, called a hierarchy. At the top is the case. This is the root. The case starts a process. The process starts a subprocess. Each instance has its own variables. So how do you reach data from another level? With scope words.

1:00 Scope words

Flowable has three scope words. Self means the current level, where you are right now. Parent means one level up, from where you are. Root always means the top-level case or process, no matter how deep you are. For example, from the subprocess, the word parent reaches the process, and the word root reaches the case.

1:20 Practice question 1

Question one. You are in a subprocess, three levels down. Which scope word always reaches the top-level case? A, self. B, parent. C, root. Or D, child.

The answer is C, root. It always means the top level.

1:43 Practice question 2

Question two. Can Flowable variables hold nested JSON data, like a customer with an address? A, yes. B, no, only flat values. C, only numbers. Or D, only in pools.

The answer is A, yes. Flowable supports simple values, and structured JSON, including arrays.

2:10 Summary

Let's review. Variables are named values. They can be simple, or structured JSON with arrays. Self is the current level, parent is one level up, and root is always the top. In the next lesson, we will compare frontend and backend expressions. Thank you for learning with us.

Practice questions

You are in a subprocess, three levels down. Which word always reaches the top-level case?

Answer: root. It always means the top level.

Can Flowable variables hold nested JSON data, like a customer with an address?

Answer: Yes. Flowable supports simple values, and structured JSON, including arrays.

Sources