Skip to content

Commit d3f4414

Browse files
authored
Merge pull request #266 from iamvirul/fix-updaterule-2201.8.x
Fix extracting rule properties in updateRule
2 parents 6fe8153 + 0039e15 commit d3f4414

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased]
99

1010
### Fixed
11+
- [Fix `updateRule` not applying filter and action changes due to incorrect field extraction from nested `SqlRule` record](https://github.com/ballerina-platform/ballerina-library/issues/8730)
1112

13+
## [3.8.2] - 2024-10-01
14+
15+
### Fixed
1216
- [Application written with `ballerina/asb` connector gives a conflicting JAR warning with `netty-buffer` and `jackson-annotations`](https://github.com/ballerina-platform/ballerina-library/issues/7061)
1317

1418
## [3.8.1] - 2024-09-30

native/src/main/java/io/ballerina/lib/asb/util/ASBUtils.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -500,13 +500,19 @@ public static SubscriptionProperties getUpdatedSubscriptionPropertiesFromBObject
500500
*/
501501
public static RuleProperties getUpdatedRulePropertiesFromBObject(BMap<BString, Object> ruleConfig,
502502
RuleProperties ruleProp) {
503-
if (ruleConfig.containsKey(ASBConstants.RECORD_FIELD_ACTION)) {
504-
ruleProp.setAction(new SqlRuleAction(
505-
ruleConfig.getStringValue(ASBConstants.RECORD_FIELD_ACTION).getValue()));
506-
}
507-
if (ruleConfig.containsKey(ASBConstants.RECORD_FIELD_FILTER)) {
508-
ruleProp.setFilter(new SqlRuleFilter(
509-
ruleConfig.getStringValue(ASBConstants.RECORD_FIELD_FILTER).getValue()));
503+
if (ruleConfig.containsKey(ASBConstants.RECORD_FIELD_SQL_RULE)) {
504+
if (ruleConfig.getMapValue(ASBConstants.RECORD_FIELD_SQL_RULE).containsKey(
505+
ASBConstants.RECORD_FIELD_ACTION)) {
506+
ruleProp.setAction(new SqlRuleAction(
507+
ruleConfig.getMapValue(ASBConstants.RECORD_FIELD_SQL_RULE).getStringValue(
508+
ASBConstants.RECORD_FIELD_ACTION).getValue()));
509+
}
510+
if (ruleConfig.getMapValue(ASBConstants.RECORD_FIELD_SQL_RULE).containsKey(
511+
ASBConstants.RECORD_FIELD_FILTER)) {
512+
ruleProp.setFilter(new SqlRuleFilter(
513+
ruleConfig.getMapValue(ASBConstants.RECORD_FIELD_SQL_RULE).getStringValue(
514+
ASBConstants.RECORD_FIELD_FILTER).getValue()));
515+
}
510516
}
511517
return ruleProp;
512518
}

0 commit comments

Comments
 (0)