Skip to content
Permalink
Browse files

Fix for notifying consoles about geofence updates

  • Loading branch information...
Miggets7 committed Jun 11, 2019
1 parent 2c6b488 commit 58c05620461f19ecb319209a38341c39be5773fe
@@ -132,7 +132,7 @@ public static Asset getConsoleParentAsset(AssetStorageService assetStorageServic
consoleParent = new Asset(CONSOLE_PARENT_ASSET_NAME, AssetType.THING);
consoleParent.setId(id);
consoleParent.setRealm(tenant.getRealm());
assetStorageService.merge(consoleParent);
consoleParent = assetStorageService.merge(consoleParent);
}
return consoleParent;
}
@@ -81,7 +81,6 @@ public RuleActionExecution(Runnable runnable, long delay) {
static class RuleTriggerState {

final TimerService timerService;
boolean notifiedLocationPredicates;
boolean trackUnmatched;
BaseAssetQuery.OrderBy orderBy;
int limit;
@@ -153,10 +152,9 @@ void updateUnfilteredAssetStates(RulesFacts facts) {
unfilteredAssetStates = facts.matchAssetState(query).collect(Collectors.toSet());

// Use this opportunity to notify RulesFacts about any location predicates
if (!notifiedLocationPredicates) {
if (facts.trackLocationRules) {
List<AttributePredicate> flattenedAttributePredicates = RuleCondition.flatten(Collections.singletonList(attributePredicates));
facts.storeLocationPredicates(getLocationPredicates(flattenedAttributePredicates));
notifiedLocationPredicates = true;
}
}
}

0 comments on commit 58c0562

Please sign in to comment.
You can’t perform that action at this time.