Filter Options for Select-type Data Items Using Parent-Child Relationships

In Select-type Data Items in Questetra BPM Suite, you can filter the displayed choices based on the value selected in another Select-type Data Item. In this article, the Data Item that serves as the source of the filtering is called the “Parent,” and the Data Item being filtered is called the “Child.” When a parent-child relationship is configured, only choices related to the value selected in the Parent are displayed in the Child, allowing process assignees to select choices sequentially starting from the Parent.

Using an Expense Reimbursement App that selects expense types across three tiers—”Expense Category” → “Expense Item” → “Breakdown”—as an example, this article explains the filtering mechanism, how to determine choice IDs, configuring parent-child relationships, registering choices, per-Step settings, and caveats when writing values in automated Steps. For a list of setting items for Select-type Data Items, refer to “Select-type“.

Workflow App Used in This Article

This is an App where employees submit expense claims, their manager approves them, and members of the Accounting Department make bank transfers. Steps progress in the order of “Application” (Start Step), “Approval”, and “Payment Processing”. In “Payment Processing”, Accounting Department members can correct erroneous selections among “Expense Category”, “Expense Item”, and “Breakdown”.

The Data Items used in this article and their settings in each Step are as follows:

Data ItemData Type“Application”“Approval”“Payment Processing”
“Expense Category” (q_expense_category)Select (Radio button)[Editable][Read-only][Editable]
“Expense Item” (q_expense_item)Select (Select box)[Editable][Read-only][Editable]
“Breakdown” (q_expense_detail)Select (Select box)[Editable][Read-only][Editable]

All three Data Items are configured with [Required].

Parent-child relationships are configured in [Dependent Parent Data Item] of the Child Data Item. The settings for the App in this article are as follows:

Data Item[Dependent Parent Data Item]
“Expense Category”None
“Expense Item”“Expense Category”
“Breakdown”“Expense Item”

“Expense Item” is a Child of “Expense Category”, and also the Parent of “Breakdown”.

How Filtering Works

Choices in the Child are filtered by choice ID. Only choices whose choice IDs begin with the choice ID of the value selected in the Parent are displayed in the Child. Display labels are not used for filtering. For example, if you select “Travel & Transportation Expenses” (choice ID: 01) in “Expense Category”, only “Local Transportation Expenses” (01-01) and “Business Trip Travel Expenses” (01-02), whose choice IDs start with 01, will appear in “Expense Item”. If you subsequently select “Business Trip Travel Expenses” in “Expense Item”, only “Shinkansen / Express Train”, “Airfare”, and “Accommodation”, whose choice IDs start with 01-02, will appear in “Breakdown”.

When nothing is selected in the Parent, no choices are displayed in the Child. Therefore, process assignees must select the Parent before the Child.

Changing the selection in the Parent clears the selection in the Child. Changing “Expense Category” clears the selection in “Expense Item”, which in turn clears the selection in “Breakdown”.

How to Determine Choice IDs

Determine choice IDs of the Child so that they start with the choice ID of the Parent. In this Expense Reimbursement App, each tier uses a 2-digit number, appending a hyphen and the number after the Parent’s choice ID. The hyphen is included to make choice IDs easier to read.

Ensure that choice IDs in the Parent have a consistent number of digits. For example, if choice IDs in “Expense Category” are set as 1, 2, …, 10, selecting 1 would also display “Expense Items” belonging to 10 (such as 10-01). Even with a delimiter hyphen, 10-01 begins with 1 and would therefore be treated as a Child of 1. Keeping the number of digits consistent, such as 01, 02, …, 10, avoids this overlap.

The choices for “Expense Category” are as follows:

Choice IDDisplay Label
01Travel & Transportation Expenses
02Meeting & Entertainment Expenses
03Supplies Expenses

The choices for “Expense Item” are as follows:

Choice IDDisplay Label
01-01Local Transportation Expenses
01-02Business Trip Travel Expenses
02-01Meeting Expenses
02-02Entertainment Expenses
03-01Office Supplies
03-02Books & Reference Materials

The choices for “Breakdown” are as follows:

Choice IDDisplay Label
01-01-01Train / Bus
01-01-02Taxi
01-02-01Shinkansen / Express Train
01-02-02Airfare
01-02-03Accommodation
02-01-01Venue Fees
02-01-02Food & Beverage during Meetings
02-02-01Business Dinners
02-02-02Gifts
03-01-01Stationery
03-01-02Printer Supplies
03-02-01Books
03-02-02Paid Databases

Configuring Parent-Child Relationships

Only Select-type Data Items whose [Form Type] is [Radio button], [Select box], or [Searchable Select box] can be designated as a Parent. Because [Checkbox] cannot be designated as a Parent, “Expense Category” and “Expense Item”, which serve as Parents, cannot be configured as [Checkbox].

In this Expense Reimbursement App, configure them in the following order. All three use [Fixed choices] for [Choice Type].

  1. Create “Expense Category” as a Select-type Data Item, set [Form Type] to [Radio button], and register its choices.
  2. Create “Expense Item” as a Select-type Data Item, set [Form Type] to [Select box], and register its choices. Select “Expense Category” for [Dependent Parent Data Item].
  3. Create “Breakdown” as a Select-type Data Item, set [Form Type] to [Select box], and register its choices. Select “Expense Item” for [Dependent Parent Data Item].
  4. In the Data Item list, arrange them in the order of “Expense Category”, “Expense Item”, and “Breakdown” so that Parents appear above Children on the form.

When setting an [Initial Value] for a Child, choose a choice that starts with the choice ID of the Parent’s [Initial Value]. If the Parent has no [Initial Value], an [Initial Value] cannot be set for the Child either. Attempting to save the App with a combination that does not satisfy this condition will result in the error “Initial value does not satisfy dependency.”

In addition to entering choices one by one in Steps 1 to 3, there are other methods available. These are explained in the next section, “Registering Choices”.

Registering Choices

For Data Items with many choices, you can register them in bulk using [CSV Edit]. In [CSV Edit] for [Fixed choices], write one choice per line with the choice ID and display label separated by a comma. For how to use [CSV Edit] and other registration methods, refer to “Creating Choice Master XML with a Text Editor / Modeler“.

Settings per Step

In “Approval”, all three Data Items are set to [Read-only]. The manager sees the values for “Expense Category”, “Expense Item”, and “Breakdown” selected by the applying employee.

In “Payment Processing”, all three are set to [Editable] so that Accounting Department members can correct erroneous selections. Correcting “Expense Item” clears the selection in “Breakdown”, so “Breakdown” must also be reselected. Because “Breakdown” is [Required], “Payment Processing” cannot be completed without reselecting it.

It is also possible to set the Parent to [Read-only] and the Child to [Editable]. This configuration is not adopted in the App in this article. In a Step where the Parent is set to [Read-only], choices filtered by the saved value of the Parent are displayed in the Child. For example, if “Expense Category” and “Expense Item” are changed to [Read-only] and only “Breakdown” is kept [Editable] in “Payment Processing”, Accounting Department members can correct only the “Breakdown” within the scope of the applied “Expense Item”.

In Steps where a Child is set to [Editable], do not set the Parent to [Not Displayed]. The Parent should be set to either [Read-only] or [Editable].

Writing Values in Automated Steps

When writing values in automated Steps, parent-child relationships must also be satisfied. Automated Steps such as [Update Data] validate written values before saving; if a parent-child relationship is not satisfied, the process terminates abnormally without updating the values.

When writing a value to a Child, specify a choice ID that starts with the Parent’s choice ID. In a Case where “Expense Item” is “01-02”, attempting to write “02-01-01”, which does not start with 01-02, to “Breakdown” will result in an abnormal termination.

Overwriting only the Parent’s value will cause the unchanged Child’s value to violate the parent-child relationship, resulting in an abnormal termination. In an automated Step that updates “Expense Category”, update the values of “Expense Item” and “Breakdown” within the same Step as well.

Related Documentation