diff options
author | Kevin Smokowski <ks6305@att.com> | 2017-05-26 18:23:42 +0000 |
---|---|---|
committer | Kevin Smokowski <ks6305@att.com> | 2017-05-26 18:23:42 +0000 |
commit | ae1e918820b3b4e70b7844b3c1d6c45dcde3b22d (patch) | |
tree | fd24d5677940db51a67ba893b7241e2d8d77abe0 /sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/CallNodeExecutor.java | |
parent | dda3edb6257146ab6599bfd44658a9791037511d (diff) |
SDNC-12 refactoring to support easy mocking
Change-Id: I5788e5b728c12bbefe83f1702f508a6a1daf22f0
Signed-off-by: Kevin Smokowski <ks6305@att.com>
Diffstat (limited to 'sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/CallNodeExecutor.java')
-rw-r--r-- | sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/CallNodeExecutor.java | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/CallNodeExecutor.java b/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/CallNodeExecutor.java index a500b6f..7b79c19 100644 --- a/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/CallNodeExecutor.java +++ b/sli/provider/src/main/java/org/openecomp/sdnc/sli/provider/CallNodeExecutor.java @@ -78,7 +78,16 @@ public class CallNodeExecutor extends SvcLogicNodeExecutor { { rpc = SvcLogicExpressionResolver.evaluate(rpcExpr, node, ctx); } - + + if ((rpc == null) || (rpc.length() == 0)) + { + if (myGraph != null) + { + rpc = myGraph.getRpc(); + LOG.debug("myGraph.getRpc() returned "+rpc); + } + } + String mode = null; moduleExpr = node.getAttribute("mode"); @@ -108,21 +117,24 @@ public class CallNodeExecutor extends SvcLogicNodeExecutor { String parentGraph = ctx.getAttribute("currentGraph"); ctx.setAttribute("parentGraph", parentGraph); - SvcLogicStore store = SvcLogicActivator.getStore(); + SvcLogicStore store = getStore(); if (store != null) { - SvcLogicGraph calledGraph = store.fetch(module, rpc, version, mode); + SvcLogicGraph calledGraph = store.fetch(module, rpc, version, mode); + LOG.debug("Parent " + parentGraph + " is calling child " + calledGraph.toString()); + ctx.setAttribute("currentGraph", calledGraph.toString()); if (calledGraph != null) { - svc.execute(calledGraph, ctx); - LOG.debug("Parent " + parentGraph + " is calling child " + calledGraph.toString()); - ctx.setAttribute("currentGraph", calledGraph.toString()); - outValue = ctx.getStatus(); + svc.execute(calledGraph, ctx); + + outValue = ctx.getStatus(); } else { - LOG.debug("Parent " + parentGraph + " failed to call child [" + module + "," + rpc + "," + version + "," + mode + "] because the graph could not be found"); - } - } else { - LOG.debug("Could not get SvcLogicStore reference"); - } + LOG.error("Could not find service logic for [" + module + "," + rpc + "," + version + "," + mode + "]"); + } + } + else + { + LOG.debug("Could not get SvcLogicStore reference"); + } SvcLogicNode nextNode = node.getOutcomeValue(outValue); if (nextNode != null) { @@ -150,5 +162,4 @@ public class CallNodeExecutor extends SvcLogicNodeExecutor { } - } |