thingsboard-aplcache

Added DELETE attributes case handle

10/16/2018 9:27:10 AM

Details

diff --git a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/action/TbCopyAttributesToEntityViewNode.java b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/action/TbCopyAttributesToEntityViewNode.java
index 5d29a43..1ab7605 100644
--- a/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/action/TbCopyAttributesToEntityViewNode.java
+++ b/rule-engine/rule-engine-components/src/main/java/org/thingsboard/rule/engine/action/TbCopyAttributesToEntityViewNode.java
@@ -113,10 +113,10 @@ public class TbCopyAttributesToEntityViewNode implements TbNode {
                                                     attributes.add(value.getAsString());
                                                 }
                                             }
-                                            List<String> filteredAttributes =
-                                                    attributes.stream().filter(attr -> attributeContainsInEntityView(scope, attr, entityView)).collect(Collectors.toList());
-                                            ctx.getAttributesService().removeAll(entityView.getId(), scope, filteredAttributes);
                                         }
+                                        List<String> filteredAttributes =
+                                                attributes.stream().filter(attr -> attributeContainsInEntityView(scope, attr, entityView)).collect(Collectors.toList());
+                                        ctx.getAttributesService().removeAll(entityView.getId(), scope, filteredAttributes);
                                         transformAndTellNext(ctx, msg, entityView);
                                     }
                                 }