You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@unomi.apache.org by ta...@apache.org on 2021/03/17 11:52:24 UTC

[unomi] branch UNOMI-444-rules created (now 5fa5a21)

This is an automated email from the ASF dual-hosted git repository.

taybou pushed a change to branch UNOMI-444-rules
in repository https://gitbox.apache.org/repos/asf/unomi.git.


      at 5fa5a21  UNOMI-444 redeploy the rules in case they are modified

This branch includes the following new commits:

     new 5fa5a21  UNOMI-444 redeploy the rules in case they are modified

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[unomi] 01/01: UNOMI-444 redeploy the rules in case they are modified

Posted by ta...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

taybou pushed a commit to branch UNOMI-444-rules
in repository https://gitbox.apache.org/repos/asf/unomi.git

commit 5fa5a21b55a85bc5554451e9ff680e9f0a940a3b
Author: Taybou <be...@gmail.com>
AuthorDate: Wed Mar 17 12:52:12 2021 +0100

    UNOMI-444 redeploy the rules in case they are modified
---
 .../org/apache/unomi/services/impl/rules/RulesServiceImpl.java   | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/services/src/main/java/org/apache/unomi/services/impl/rules/RulesServiceImpl.java b/services/src/main/java/org/apache/unomi/services/impl/rules/RulesServiceImpl.java
index e99bb7e..8ccc767 100644
--- a/services/src/main/java/org/apache/unomi/services/impl/rules/RulesServiceImpl.java
+++ b/services/src/main/java/org/apache/unomi/services/impl/rules/RulesServiceImpl.java
@@ -142,13 +142,8 @@ public class RulesServiceImpl implements RulesService, EventListenerService, Syn
 
             try {
                 Rule rule = CustomObjectMapper.getObjectMapper().readValue(predefinedRuleURL, Rule.class);
-                // Register only if rule does not exist yet
-                if (getRule(rule.getMetadata().getId()) == null) {
-                    setRule(rule);
-                    logger.info("Predefined rule with id {} registered", rule.getMetadata().getId());
-                } else {
-                    logger.info("The predefined rule with id {} is already registered, this rule will be skipped", rule.getMetadata().getId());
-                }
+                setRule(rule);
+                logger.info("Predefined rule with id {} registered", rule.getMetadata().getId());
             } catch (IOException e) {
                 logger.error("Error while loading rule definition " + predefinedRuleURL, e);
             }