-
Notifications
You must be signed in to change notification settings - Fork 27
Reevaluation Changes for core Launch Rules Engine #797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
7aa9528
Reevaluatoin Added to Launch Rules Engine
sagar-sharma-adobe f3b0112
Updated Reevaluation logic and added test cases for backward compatib…
sagar-sharma-adobe 5149dd9
Adding Reevaluable key parsing logic to JSONRule and JSONRuleRoot
sagar-sharma-adobe d30ff81
Reevaluation based on consequence type added
sagar-sharma-adobe 4956617
Launch Rules Engine Unit Tes cases fix
sagar-sharma-adobe d4866bf
Using processed event later for reevaluation processing as well
sagar-sharma-adobe 1eb3ec9
Unit test cases for Reevaluation flow
sagar-sharma-adobe 6882148
Updating parsing and unit test cases
sagar-sharma-adobe 278eae0
Adding a default value for reEvaluable flag in Meta Object
sagar-sharma-adobe df0a37e
Updating reevaluation key in meta object from "reEvaluable" to "reEva…
sagar-sharma-adobe 8c0df49
Updating Core version to 3.5.1
github-actions[bot] 372642c
Merge pull request #795 from adobe/core-update-version-3.5.1
sagar-sharma-adobe 6263b92
Updating Core version to 3.6.0
github-actions[bot] 8555e18
Merge pull request #796 from adobe/core-update-version-3.6.0
sagar-sharma-adobe a28d476
Spotless Apply
sagar-sharma-adobe a703a49
Merge remote-tracking branch 'origin/dev-v3.6.0' into main_reevaluati…
sagar-sharma-adobe c52ba74
Fixing Unit Test case assertion
sagar-sharma-adobe 5bff154
Adding API changes declaration to core.api
sagar-sharma-adobe 1d2880c
Addressing review Comments
sagar-sharma-adobe 855cb00
Spotless Apply
sagar-sharma-adobe 2a6cc19
Updating callback to AdobeCallback
sagar-sharma-adobe 116f07e
Updating callback to AdobeCallback
sagar-sharma-adobe 9bd4ce9
SpotlessApply
sagar-sharma-adobe 781bd01
checkStyle fixes
sagar-sharma-adobe 90e280f
Updating public API
sagar-sharma-adobe 69592e0
Updating Core version to 3.5.1
github-actions[bot] 7c094a2
Merge pull request #798 from adobe/core-update-version-3.5.1
sagar-sharma-adobe 6aa73d4
Merge remote-tracking branch 'origin/staging' into dev-v3.6.0
sagar-sharma-adobe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
23 changes: 23 additions & 0 deletions
23
code/core/src/main/java/com/adobe/marketing/mobile/launch/rulesengine/RuleMeta.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| Copyright 2022 Adobe. All rights reserved. | ||
| This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. You may obtain a copy | ||
| of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
| Unless required by applicable law or agreed to in writing, software distributed under | ||
| the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
| OF ANY KIND, either express or implied. See the License for the specific language | ||
| governing permissions and limitations under the License. | ||
| */ | ||
|
|
||
| package com.adobe.marketing.mobile.launch.rulesengine | ||
|
|
||
| /** | ||
| * The data class representing a rule's consequence object | ||
| * | ||
| * @property reEvaluate the flag reEvaluate for sensitive rules | ||
| * @constructor Constructs a new [RuleMeta] | ||
| */ | ||
|
|
||
| data class RuleMeta( | ||
| val reEvaluate: Boolean = false, | ||
| ) |
28 changes: 28 additions & 0 deletions
28
...rc/main/java/com/adobe/marketing/mobile/launch/rulesengine/RuleReevaluationInterceptor.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| /* | ||
| Copyright 2026 Adobe. All rights reserved. | ||
| This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. You may obtain a copy | ||
| of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
| Unless required by applicable law or agreed to in writing, software distributed under | ||
| the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
| OF ANY KIND, either express or implied. See the License for the specific language | ||
| governing permissions and limitations under the License. | ||
| */ | ||
|
|
||
| package com.adobe.marketing.mobile.launch.rulesengine | ||
|
|
||
| import com.adobe.marketing.mobile.AdobeCallback | ||
| import com.adobe.marketing.mobile.Event | ||
|
|
||
| /** | ||
| * An interface for an interceptor that is triggered when a [LaunchRule] with the | ||
| * re-evaluation flag is triggered. The interceptor is responsible for updating the rules and | ||
| * invoking the [AdobeCallback] when complete. success is passed as a boolean value. | ||
| */ | ||
| interface RuleReevaluationInterceptor { | ||
| fun onReevaluationTriggered( | ||
| event: Event?, | ||
| revaluableRules: List<LaunchRule?>?, | ||
| callback: AdobeCallback<Boolean>? | ||
| ) | ||
| } |
54 changes: 54 additions & 0 deletions
54
code/core/src/main/java/com/adobe/marketing/mobile/launch/rulesengine/json/JSONMeta.kt
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| /* | ||
| Copyright 2022 Adobe. All rights reserved. | ||
| This file is licensed to you under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. You may obtain a copy | ||
| of the License at http://www.apache.org/licenses/LICENSE-2.0 | ||
| Unless required by applicable law or agreed to in writing, software distributed under | ||
| the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS | ||
| OF ANY KIND, either express or implied. See the License for the specific language | ||
| governing permissions and limitations under the License. | ||
| */ | ||
|
|
||
| package com.adobe.marketing.mobile.launch.rulesengine.json | ||
|
|
||
| import com.adobe.marketing.mobile.launch.rulesengine.RuleMeta | ||
| import org.json.JSONObject | ||
|
|
||
| /** | ||
| * Generic utility to parse a meta object from JSON for rules engine. | ||
| * | ||
| * This class is responsible for extracting meta information from a JSON object. | ||
| * Currently, it only parses the `reEvaluate` flag, but it is designed to be extended | ||
| * in the future to support additional meta keys as needed. | ||
| * | ||
| * Example of a meta JSON object: | ||
| * ```json | ||
| * { | ||
| * "reEvaluate": true | ||
| * } | ||
| * ``` | ||
| * | ||
| * Future meta keys can be added to this class as requirements evolve. | ||
| */ | ||
| internal class JSONMeta private constructor( | ||
|
sagar-sharma-adobe marked this conversation as resolved.
|
||
| private val reEvaluate: Boolean, | ||
| ) { | ||
| companion object { | ||
| private const val KEY_REEVALUATE = "reEvaluate" | ||
| operator fun invoke(jsonObject: JSONObject?): JSONMeta { | ||
| return JSONMeta( | ||
| jsonObject?.optBoolean(KEY_REEVALUATE, false) ?: false | ||
| ) | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Converts this object into a validated [RuleMeta]. | ||
| * | ||
| * @return a valid [RuleMeta] or `null` if any validation check fails | ||
| */ | ||
| @JvmSynthetic | ||
| internal fun toMeta(): RuleMeta { | ||
| return RuleMeta(reEvaluate) | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.