Browse Source

Updated property name for clarity

pull/14560/head
dshvaika 10 months ago
parent
commit
bbb4d637b4
  1. 2
      application/src/main/java/org/thingsboard/server/actors/calculatedField/CalculatedFieldEntityMessageProcessor.java
  2. 10
      application/src/main/java/org/thingsboard/server/service/cf/ctx/state/CalculatedFieldCtx.java

2
application/src/main/java/org/thingsboard/server/actors/calculatedField/CalculatedFieldEntityMessageProcessor.java

@ -469,7 +469,7 @@ public class CalculatedFieldEntityMessageProcessor extends AbstractContextAwareM
state.setCtx(ctx, actorCtx); state.setCtx(ctx, actorCtx);
state.init(false); state.init(false);
if (ctx.getCfType() == CalculatedFieldType.GEOFENCING && ctx.isRelationPathSource()) { if (ctx.getCfType() == CalculatedFieldType.GEOFENCING && ctx.isCfHasRelationPathQuerySource()) {
GeofencingCalculatedFieldState geofencingState = (GeofencingCalculatedFieldState) state; GeofencingCalculatedFieldState geofencingState = (GeofencingCalculatedFieldState) state;
geofencingState.updateScheduledRefreshTs(); geofencingState.updateScheduledRefreshTs();
} }

10
application/src/main/java/org/thingsboard/server/service/cf/ctx/state/CalculatedFieldCtx.java

@ -121,7 +121,7 @@ public class CalculatedFieldCtx implements Closeable {
private long maxSingleValueArgumentSize; private long maxSingleValueArgumentSize;
private long intermediateAggregationIntervalMillis; private long intermediateAggregationIntervalMillis;
private boolean relationPathSource; private boolean cfHasRelationPathQuerySource;
private List<String> mainEntityGeofencingArgumentNames; private List<String> mainEntityGeofencingArgumentNames;
private List<String> linkedEntityAndCurrentOwnerGeofencingArgumentNames; private List<String> linkedEntityAndCurrentOwnerGeofencingArgumentNames;
private List<String> relatedEntityArgumentNames; private List<String> relatedEntityArgumentNames;
@ -160,11 +160,11 @@ public class CalculatedFieldCtx implements Closeable {
if (refId == null) { if (refId == null) {
if (CalculatedFieldType.RELATED_ENTITIES_AGGREGATION.equals(cfType)) { if (CalculatedFieldType.RELATED_ENTITIES_AGGREGATION.equals(cfType)) {
relatedEntityArguments.compute(refKey, (key, existingNames) -> CollectionsUtil.addToSet(existingNames, entry.getKey())); relatedEntityArguments.compute(refKey, (key, existingNames) -> CollectionsUtil.addToSet(existingNames, entry.getKey()));
relationPathSource = true; cfHasRelationPathQuerySource = true;
continue; continue;
} }
if (entry.getValue().hasRelationQuerySource()) { if (entry.getValue().hasRelationQuerySource()) {
relationPathSource = true; cfHasRelationPathQuerySource = true;
continue; continue;
} }
if (entry.getValue().hasOwnerSource()) { if (entry.getValue().hasOwnerSource()) {
@ -201,7 +201,7 @@ public class CalculatedFieldCtx implements Closeable {
if (calculatedField.getConfiguration() instanceof PropagationCalculatedFieldConfiguration propagationConfig) { if (calculatedField.getConfiguration() instanceof PropagationCalculatedFieldConfiguration propagationConfig) {
propagationArgument = propagationConfig.toPropagationArgument(); propagationArgument = propagationConfig.toPropagationArgument();
applyExpressionForResolvedArguments = propagationConfig.isApplyExpressionToResolvedArguments(); applyExpressionForResolvedArguments = propagationConfig.isApplyExpressionToResolvedArguments();
relationPathSource = true; cfHasRelationPathQuerySource = true;
} }
} }
if (calculatedField.getConfiguration() instanceof ScheduledUpdateSupportedCalculatedFieldConfiguration scheduledConfig) { if (calculatedField.getConfiguration() instanceof ScheduledUpdateSupportedCalculatedFieldConfiguration scheduledConfig) {
@ -759,7 +759,7 @@ public class CalculatedFieldCtx implements Closeable {
} }
public boolean shouldFetchRelatedEntities(CalculatedFieldState state) { public boolean shouldFetchRelatedEntities(CalculatedFieldState state) {
if (!relationPathSource) { if (!cfHasRelationPathQuerySource) {
return false; return false;
} }
if (isScheduledUpdateDisabled()) { if (isScheduledUpdateDisabled()) {

Loading…
Cancel
Save