throw an exception if an executor is missing
authorSmokowski, Kevin (ks6305) <kevin.smokowski@att.com>
Thu, 4 Oct 2018 19:18:28 +0000 (19:18 +0000)
committerSmokowski, Kevin (ks6305) <kevin.smokowski@att.com>
Thu, 4 Oct 2018 19:18:28 +0000 (19:18 +0000)
If trying to execute a node of a type which has no registered executor throw an exception instead of continuing to execute

Change-Id: Ic0a785e97ad85eb886f822e87a78347d9ea6563a
Issue-ID: CCSDK-610
Signed-off-by: Smokowski, Kevin (ks6305) <kevin.smokowski@att.com>
sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index d83bfeb..000c287
@@ -70,6 +70,7 @@ public class SvcLogicServiceImpl implements SvcLogicService {
             put("update", new UpdateNodeExecutor());
             put("break", new BreakNodeExecutor());
             put("while", new WhileNodeExecutor());
+
         }
     };
 
@@ -180,28 +181,7 @@ public class SvcLogicServiceImpl implements SvcLogicService {
                     executor.getClass().getName());
             return (executor.execute(this, node, ctx));
         } else {
-            if (LOG.isDebugEnabled()) {
-                LOG.debug("{} node not implemented", node.getNodeType());
-            }
-            SvcLogicNode nextNode = node.getOutcomeValue("failure");
-            if (nextNode != null) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("about to execute failure branch");
-                }
-                return (nextNode);
-            }
-
-            nextNode = node.getOutcomeValue("Other");
-            if (nextNode != null) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("about to execute Other branch");
-                }
-            } else {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("no failure or Other branch found");
-                }
-            }
-            return (nextNode);
+            throw new SvcLogicException("Attempted to execute a node of type " + node.getNodeType() + ", but no executor was registered for this type");
         }
     }