docs: clarify that program rule assign values aren't shared between rules (DHIS2-20691)#1768
Open
karolinelien wants to merge 1 commit into
Open
docs: clarify that program rule assign values aren't shared between rules (DHIS2-20691)#1768karolinelien wants to merge 1 commit into
karolinelien wants to merge 1 commit into
Conversation
…(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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-engine3.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)Written for program designers rather than developers — no engine internals.
AI Assisted