Skip to content

chore: Upgrade rule-engine library version [DHIS2-20814]#22956

Merged
enricocolasante merged 1 commit intomasterfrom
DHIS2-20814
Feb 16, 2026
Merged

chore: Upgrade rule-engine library version [DHIS2-20814]#22956
enricocolasante merged 1 commit intomasterfrom
DHIS2-20814

Conversation

@enricocolasante
Copy link
Contributor

@enricocolasante enricocolasante commented Feb 12, 2026

Upgrade to last version of rule-engine and fixing introduced breaking changes by this rule-engine PR dhis2/dhis2-rule-engine#173

When building the context for rule-engine thre are 2 changes:

  • RuleEvent has a new createdAtClientDate field
  • eventDate field in RuleEvent changed type from RuleInstant to RuleLocalDate

@sonarqubecloud
Copy link

@enricocolasante enricocolasante marked this pull request as ready for review February 13, 2026 08:24
@@ -172,9 +172,12 @@ private static RuleEvent mapPayloadTrackerEvent(
programStage.getName(),
RuleEventStatus.valueOf(eventToEvaluate.getStatus().toString()),
eventToEvaluate.getOccurredAt() != null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is not new to this PR, but just wanted to confirm the expected value here. So, if the occurredAt is null, does it fallback to scheduledAt? In the Android app we don't fallback to scheduledAt, actually we skipt the events whose state is SCHEDULE, SKIPPED or OVERDUE. Should we change anything here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this is a bigger discussion than a comment on a PR 😅
So you never run program rules on scheduled events?
We have due_date as a program rule variable so it can be used in expressions. You could have a rule that will do something when the due date is approaching.
And as well, some functions like d2:count will give you different result if you consider or not scheduled events.
The idea behind defaulting occurredAt to scheduledAt is that we consider scheduled events as events that will happen and the best guess is to use the scheduledAt date.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it seems to be a bigger discussion, I take note and will bring it up at some point.
Everything looks good to me!

@enricocolasante enricocolasante merged commit a67b28a into master Feb 16, 2026
16 checks passed
@enricocolasante enricocolasante deleted the DHIS2-20814 branch February 16, 2026 12:44
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.

4 participants