chore: Upgrade rule-engine library version [DHIS2-20814]#22956
chore: Upgrade rule-engine library version [DHIS2-20814]#22956enricocolasante merged 1 commit intomasterfrom
Conversation
|
| @@ -172,9 +172,12 @@ private static RuleEvent mapPayloadTrackerEvent( | |||
| programStage.getName(), | |||
| RuleEventStatus.valueOf(eventToEvaluate.getStatus().toString()), | |||
| eventToEvaluate.getOccurredAt() != null | |||
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Yes, it seems to be a bigger discussion, I take note and will bring it up at some point.
Everything looks good to me!



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:
RuleEventhas a newcreatedAtClientDatefieldeventDatefield inRuleEventchanged type fromRuleInstanttoRuleLocalDate