From a68b1d51bdb4b5fb8575b7029b86d2d1abbfdace Mon Sep 17 00:00:00 2001 From: "Smokowski, Kevin (ks6305)" Date: Thu, 4 Oct 2018 19:18:28 +0000 Subject: throw an exception if an executor is missing 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) --- .../sli/core/sli/provider/SvcLogicServiceImpl.java | 24 ++-------------------- 1 file changed, 2 insertions(+), 22 deletions(-) mode change 100644 => 100755 sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java diff --git a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java old mode 100644 new mode 100755 index d83bfebc..000c2872 --- a/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java +++ b/sli/provider/src/main/java/org/onap/ccsdk/sli/core/sli/provider/SvcLogicServiceImpl.java @@ -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"); } } -- cgit 1.2.3-korg