Added reEvaluation support for rules engine#1195
Added reEvaluation support for rules engine#1195akhiljain1907 merged 21 commits intoadobe:dev-v5.8.0from
Conversation
…ore-ios into feat/ReEvaluation
…reevaluation APIs to AEPCore
…reevaluation APIs to AEPCore
…ore-ios into feat/ReEvaluation # Conflicts: # API/AEPCore-ios.json # API/AEPCore-tvos.json
…terceptor instead of passing the original event
sbenedicadb
left a comment
There was a problem hiding this comment.
looks good with just a few updates requested 👍
| public struct LaunchRule: Rule { | ||
| public let condition: Evaluable | ||
| public let consequences: [RuleConsequence] | ||
| public let reevaluable: Bool |
There was a problem hiding this comment.
i think it's better to pull in the meta dictionary here rather than one specific value inside that dictionary.
this puts us in a better place for future usage of the meta object inside of a launch rule to deliver new properties, etc.
we could make reEvaluable a read-only computed property for convenience.
There was a problem hiding this comment.
Yes, we should have the meta dictionary passed instead of just reEvaluate key for future usage. I have made that change.
| enum CodingKeys: String, CodingKey { | ||
| case reEvaluate | ||
| } |
There was a problem hiding this comment.
don't need coding keys enum since the property name we are using is the same as the named coding key
There was a problem hiding this comment.
Yes i have removed it.
|
|
||
| /// Metadata for a rule containing reevaluation settings | ||
| struct JSONRuleMeta: Codable { | ||
| var reEvaluate: Bool? |
There was a problem hiding this comment.
might be more clear to a reader and safer to just make this value non-optional, and with a default value?
let reEvaluate: Bool = false
There was a problem hiding this comment.
As i am parsing entire meta dictionary now, i have removed this JSONRuleMeta struct.
|
Thanks a lot @sbenedicadb for reviewing. I have addressed the comments, can you please take a look and approve if it looks good? |
Description
This PR adds support for parsing the meta object with reEvaluate key in rules JSON and introduces a re-evaluation mechanism for the Launch Rules Engine.
Changes
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: