Browse Source
Merge pull request #14726 from irynamatveieva/fix/cf-debug-event
Fixed calculated field debug event: excluded argument from debug event if empty
pull/14727/head
Viacheslav Klimov
5 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with
4 additions and
2 deletions
-
application/src/main/java/org/thingsboard/server/actors/ActorSystemContext.java
-
application/src/main/java/org/thingsboard/server/service/cf/ctx/state/BaseCalculatedFieldState.java
|
|
|
@ -846,7 +846,7 @@ public class ActorSystemContext { |
|
|
|
if (tbMsgType != null) { |
|
|
|
eventBuilder.msgType(tbMsgType); |
|
|
|
} |
|
|
|
if (arguments != null) { |
|
|
|
if (arguments != null && !arguments.isEmpty()) { |
|
|
|
eventBuilder.arguments(JacksonUtil.toString(arguments)); |
|
|
|
} |
|
|
|
if (result != null) { |
|
|
|
|
|
|
|
@ -201,7 +201,9 @@ public abstract class BaseCalculatedFieldState implements CalculatedFieldState, |
|
|
|
@Override |
|
|
|
public JsonNode getArgumentsJson() { |
|
|
|
return JacksonUtil.valueToTree(arguments.entrySet().stream() |
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().jsonValue()))); |
|
|
|
.filter(entry -> !entry.getValue().isEmpty()) |
|
|
|
.collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().jsonValue())) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|