Browse Source

fixed process right away strategy for propagation cf

pull/14372/head
IrynaMatveieva 10 months ago
parent
commit
a225a71209
  1. 4
      application/src/main/java/org/thingsboard/server/service/cf/DefaultCalculatedFieldProcessingService.java
  2. 4
      application/src/test/java/org/thingsboard/server/cf/CalculatedFieldIntegrationTest.java

4
application/src/main/java/org/thingsboard/server/service/cf/DefaultCalculatedFieldProcessingService.java

@ -156,7 +156,7 @@ public class DefaultCalculatedFieldProcessingService extends AbstractCalculatedF
} }
if (result instanceof PropagationCalculatedFieldResult propagationResult) { if (result instanceof PropagationCalculatedFieldResult propagationResult) {
handlePropagationResults(propagationResult, callback, handlePropagationResults(propagationResult, callback,
(entity, res, cb) -> saveTelemetryResult(tenantId, entityId, res, cfIds, cb)); (entity, res, cb) -> saveTelemetryResult(tenantId, entity, res, cfIds, cb));
return; return;
} }
callback.onSuccess(); callback.onSuccess();
@ -165,7 +165,7 @@ public class DefaultCalculatedFieldProcessingService extends AbstractCalculatedF
private void pushMsgToRuleEngine(TenantId tenantId, EntityId entityId, CalculatedFieldResult result, List<CalculatedFieldId> cfIds, TbCallback callback) { private void pushMsgToRuleEngine(TenantId tenantId, EntityId entityId, CalculatedFieldResult result, List<CalculatedFieldId> cfIds, TbCallback callback) {
if (result instanceof PropagationCalculatedFieldResult propagationResult) { if (result instanceof PropagationCalculatedFieldResult propagationResult) {
handlePropagationResults(propagationResult, callback, handlePropagationResults(propagationResult, callback,
(entity, res, cb) -> sendMsgToRuleEngine(tenantId, entityId, cb, res.toTbMsg(entity, cfIds))); (entity, res, cb) -> sendMsgToRuleEngine(tenantId, entity, cb, res.toTbMsg(entity, cfIds)));
return; return;
} }

4
application/src/test/java/org/thingsboard/server/cf/CalculatedFieldIntegrationTest.java

@ -1099,7 +1099,9 @@ public class CalculatedFieldIntegrationTest extends CalculatedFieldControllerTes
arg.setRefEntityKey(new ReferencedEntityKey("temperature", ArgumentType.TS_LATEST, null)); arg.setRefEntityKey(new ReferencedEntityKey("temperature", ArgumentType.TS_LATEST, null));
cfg.setArguments(Map.of("temperatureComputed", arg)); cfg.setArguments(Map.of("temperatureComputed", arg));
cfg.setOutput(new TimeSeriesOutput()); TimeSeriesOutput output = new TimeSeriesOutput();
output.setStrategy(new TimeSeriesImmediateOutputStrategy(0, true, true, true, true));
cfg.setOutput(output);
cf.setConfiguration(cfg); cf.setConfiguration(cfg);

Loading…
Cancel
Save