Skip to content

docs: clarify that program rule assign values aren't shared between rules (DHIS2-20691)#1768

Open
karolinelien wants to merge 1 commit into
masterfrom
docs/dhis2-20691-program-rule-assign-cascade
Open

docs: clarify that program rule assign values aren't shared between rules (DHIS2-20691)#1768
karolinelien wants to merge 1 commit into
masterfrom
docs/dhis2-20691-program-rule-assign-cascade

Conversation

@karolinelien

@karolinelien karolinelien commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

What

Clarifies a confusing program-rule behaviour in the Configure programs in the Maintenance app guide: a value that one program rule assigns to a data element or tracked entity attribute is shown to the user but is not visible to the conditions of other program rules until the user next edits the form. Only Calculated value program rule variables are shared between rules immediately.

Why

Reported in DHIS2-20691 and DHIS2-21670: e.g. Rule 1 fills in a field, Rule 2 warns when that field is empty, and the warning fires anyway because Rule 2 doesn't see the value Rule 1 just assigned. This is working as designed (and consistent across the web, Android, and server-side rule engines), but it isn't documented. The docs already name the Calculated value variable as the mechanism for passing values between rules, but never state the limitation that makes the above surprising.

I verified the supported workaround actually works by running the rule engine (@dhis2/rule-engine 3.8.1): assigning to a Calculated value variable does propagate to a later rule in the same run, whereas assigning to a data element / TEA does not.

Changes (one file: src/user/configure-programs-in-the-maintenance-app.md)

  1. A plain-language note after the program rule priority example, with a worked First name / Last name example and two ways out.
  2. An added caveat to the Assign value action description.
  3. A clarifying sentence on the Calculated value variable description.

Written for program designers rather than developers — no engine internals.

AI Assisted

…(DHIS2-20691)

A value assigned to a data element or tracked entity attribute is shown to
the user but isn't visible to other program rules until the next form edit;
only Calculated value variables are shared between rules immediately. This
caused confusing behaviour reported in DHIS2-20691 / DHIS2-21670 (e.g. a
"field is empty" warning firing right after another rule filled the field).

Adds a plain-language note in the program rule priority section and clarifies
the "Assign value" action and "Calculated value" variable descriptions.

AI Assisted

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@karolinelien karolinelien marked this pull request as ready for review June 23, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant