2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * =============================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
19 * ECOMP is a trademark and service mark of AT&T Intellectual Property.
20 * ============LICENSE_END=========================================================
23 package org.onap.appc.flow.controller.node;
25 import com.att.eelf.configuration.EELFLogger;
26 import com.att.eelf.configuration.EELFManager;
27 import com.fasterxml.jackson.annotation.JsonInclude.Include;
28 import com.fasterxml.jackson.databind.DeserializationFeature;
29 import com.fasterxml.jackson.databind.JsonNode;
30 import com.fasterxml.jackson.databind.ObjectMapper;
31 import com.fasterxml.jackson.databind.SerializationFeature;
32 import java.io.FileInputStream;
33 import java.io.IOException;
34 import java.io.InputStream;
35 import java.util.ArrayList;
36 import java.util.Arrays;
37 import java.util.HashMap;
38 import java.util.List;
40 import java.util.Properties;
41 import org.apache.commons.lang3.StringUtils;
42 import org.json.JSONObject;
43 import org.onap.appc.flow.controller.ResponseHandlerImpl.DefaultResponseHandler;
44 import org.onap.appc.flow.controller.data.PrecheckOption;
45 import org.onap.appc.flow.controller.data.ResponseAction;
46 import org.onap.appc.flow.controller.data.Transaction;
47 import org.onap.appc.flow.controller.data.Transactions;
48 import org.onap.appc.flow.controller.dbervices.FlowControlDBService;
49 import org.onap.appc.flow.controller.executorImpl.GraphExecutor;
50 import org.onap.appc.flow.controller.executorImpl.NodeExecutor;
51 import org.onap.appc.flow.controller.executorImpl.RestExecutor;
52 import org.onap.appc.flow.controller.interfaceData.ActionIdentifier;
53 import org.onap.appc.flow.controller.interfaceData.Capabilities;
54 import org.onap.appc.flow.controller.interfaceData.DependencyInfo;
55 import org.onap.appc.flow.controller.interfaceData.Input;
56 import org.onap.appc.flow.controller.interfaceData.InventoryInfo;
57 import org.onap.appc.flow.controller.interfaceData.RequestInfo;
58 import org.onap.appc.flow.controller.interfaceData.Vm;
59 import org.onap.appc.flow.controller.interfaceData.VnfInfo;
60 import org.onap.appc.flow.controller.interfaceData.Vnfcs;
61 import org.onap.appc.flow.controller.interfaceData.Vnfcslist;
62 import org.onap.appc.flow.controller.interfaces.FlowExecutorInterface;
63 import org.onap.appc.flow.controller.utils.EncryptionTool;
64 import org.onap.appc.flow.controller.utils.FlowControllerConstants;
65 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
66 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
67 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
69 public class FlowControlNode implements SvcLogicJavaPlugin {
71 private static final EELFLogger log = EELFManager.getInstance().getLogger(FlowControlNode.class);
72 private static final String SDNC_CONFIG_DIR_VAR = "SDNC_CONFIG_DIR";
74 public void processFlow(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
75 log.debug("Received processParamKeys call with params : " + inParams);
76 String responsePrefix = inParams.get(FlowControllerConstants.INPUT_PARAM_RESPONSE_PREFIX);
78 responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix + ".") : "";
79 SvcLogicContext localContext = new SvcLogicContext();
81 localContext.setAttribute(FlowControllerConstants.REQUEST_ID,
82 ctx.getAttribute(FlowControllerConstants.REQUEST_ID));
83 localContext.setAttribute(FlowControllerConstants.VNF_TYPE,
84 ctx.getAttribute(FlowControllerConstants.VNF_TYPE));
85 localContext.setAttribute(FlowControllerConstants.REQUEST_ACTION,
86 ctx.getAttribute(FlowControllerConstants.REQUEST_ACTION));
87 localContext.setAttribute(FlowControllerConstants.ACTION_LEVEL,
88 ctx.getAttribute(FlowControllerConstants.ACTION_LEVEL));
89 localContext.setAttribute(FlowControllerConstants.RESPONSE_PREFIX,
91 ctx.setAttribute(FlowControllerConstants.RESPONSE_PREFIX,
94 FlowControlDBService dbservice = FlowControlDBService.initialise();
95 dbservice.getFlowReferenceData(ctx, inParams, localContext);
97 for (Object key : localContext.getAttributeKeySet()) {
98 String parmName = (String) key;
99 String parmValue = ctx.getAttribute(parmName);
100 log.debug("processFlow " + parmName + "=" + parmValue);
103 processFlowSequence(inParams, ctx, localContext);
104 if (!ctx.getAttribute(responsePrefix + FlowControllerConstants.OUTPUT_PARAM_STATUS)
105 .equals(FlowControllerConstants.OUTPUT_STATUS_SUCCESS)) {
107 throw new SvcLogicException(
108 ctx.getAttribute(responsePrefix + FlowControllerConstants.OUTPUT_STATUS_MESSAGE));
111 } catch (Exception e) {
112 ctx.setAttribute(responsePrefix + FlowControllerConstants.OUTPUT_PARAM_STATUS,
113 FlowControllerConstants.OUTPUT_STATUS_FAILURE);
114 ctx.setAttribute(responsePrefix + FlowControllerConstants.OUTPUT_PARAM_ERROR_MESSAGE,
116 log.error("Error occured in processFlow ", e);
117 throw new SvcLogicException(e.getMessage());
121 private void processFlowSequence(Map<String, String> inParams, SvcLogicContext ctx, SvcLogicContext localContext)
124 String fn = "FlowExecutorNode.processflowSequence";
125 log.debug(fn + "Received model for flow : " + localContext.toString());
126 FlowControlDBService dbservice = FlowControlDBService.initialise();
127 String flowSequnce = null;
128 for (Object key : localContext.getAttributeKeySet()) {
129 String parmName = (String) key;
130 String parmValue = ctx.getAttribute(parmName);
131 log.debug(parmName + "=" + parmValue);
134 if (localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE) != null) {
135 if (localContext.getAttribute(FlowControllerConstants.GENERATION_NODE) != null) {
136 GraphExecutor transactionExecutor = new GraphExecutor();
137 Boolean generatorExists = transactionExecutor.hasGraph(
139 localContext.getAttribute(FlowControllerConstants.GENERATION_NODE),
143 if (generatorExists) {
144 flowSequnce = transactionExecutor.executeGraph(
146 localContext.getAttribute(FlowControllerConstants.GENERATION_NODE),
148 .getProperty(FlowControllerConstants.FLOW_SEQUENCE);
150 throw new Exception("Can not find Custom defined Flow Generator for "
151 + localContext.getAttribute(FlowControllerConstants.GENERATION_NODE));
154 } else if ((localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE))
155 .equalsIgnoreCase(FlowControllerConstants.DESINGTIME)) {
157 localContext.setAttribute(FlowControllerConstants.VNFC_TYPE,
158 ctx.getAttribute(FlowControllerConstants.VNFC_TYPE));
159 flowSequnce = dbservice.getDesignTimeFlowModel(localContext);
161 if (flowSequnce == null) {
162 throw new Exception("Flow Sequence is not found User Desinged VNF "
163 + ctx.getAttribute(FlowControllerConstants.VNF_TYPE));
166 } else if ((localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE))
167 .equalsIgnoreCase(FlowControllerConstants.RUNTIME)) {
169 Transaction transaction = new Transaction();
170 String input = collectInputParams(ctx,transaction);
171 log.info("CollectInputParamsData-Input: " + input);
173 RestExecutor restExe = new RestExecutor();
174 Map<String,String> flowSeq = restExe.execute(transaction, localContext);
176 JSONObject sequence = new JSONObject(flowSeq.get("restResponse"));
177 if (sequence.has("output")) {
178 flowSequnce = sequence.getJSONObject("output").toString();
180 log.info("MultistepSequenceGenerator-Output: " + flowSequnce);
182 if (flowSequnce == null) {
183 throw new Exception("Failed to get the Flow Sequece runtime for VNF type"
184 + ctx.getAttribute(FlowControllerConstants.VNF_TYPE));
187 } else if ((localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE))
188 .equalsIgnoreCase(FlowControllerConstants.EXTERNAL)) {
189 //String input = collectInputParams(localContext);
190 // flowSequnce = ""; //get it from the External interface calling the Rest End point - TBD
191 //if(flowSequnce == null)
193 throw new Exception("Flow Sequence not found for "
194 + ctx.getAttribute(FlowControllerConstants.VNF_TYPE));
197 //No other type of model supported...
198 //in Future can get flowModel from other generators which will be included here
199 throw new Exception("No information found for sequence Owner Design-Time Vs Run-Time" );
203 FlowGenerator flowGenerator = new FlowGenerator();
204 Transactions trans = flowGenerator.createSingleStepModel(inParams,ctx);
205 ObjectMapper mapper = new ObjectMapper();
206 flowSequnce = mapper.writeValueAsString(trans);
207 log.debug("Single step Flow Sequence : " + flowSequnce);
210 log.debug("Received Flow Sequence : " + flowSequnce);
211 HashMap<Integer, Transaction> transactionMap = createTransactionMap(flowSequnce, localContext);
212 exeuteAllTransaction(transactionMap, ctx);
213 log.info("Executed all the transacstion successfully");
216 private void exeuteAllTransaction(HashMap<Integer, Transaction> transactionMap, SvcLogicContext ctx)
219 String fn = "FlowExecutorNode.exeuteAllTransaction ";
221 FlowExecutorInterface flowExecutor;
222 for (int key = 1; key <= transactionMap.size() ; key++) {
223 log.debug(fn + "Starting transactions ID " + key + " :)=" + retry);
224 Transaction transaction = transactionMap.get(key);
225 if (!preProcessor(transactionMap, transaction)) {
226 log.info("Skipping Transaction ID " + transaction.getTransactionId());
229 if (transaction.getExecutionType() != null) {
230 switch (transaction.getExecutionType()) {
231 case FlowControllerConstants.GRAPH :
232 flowExecutor = new GraphExecutor();
234 case FlowControllerConstants.NODE :
235 flowExecutor = new NodeExecutor();
237 case FlowControllerConstants.REST :
238 flowExecutor = new RestExecutor();
241 throw new Exception("No Executor found for transaction ID" + transaction.getTransactionId());
243 flowExecutor.execute(transaction, ctx);
244 ResponseAction responseAction = handleResponse(transaction);
246 if (responseAction.getWait() != null && Integer.parseInt(responseAction.getWait()) > 0) {
247 log.debug(fn + "Going to Sleep .... " + responseAction.getWait());
248 Thread.sleep(Integer.parseInt(responseAction.getWait()) * 1000L);
250 if (responseAction.isIntermediateMessage()) {
251 log.debug(fn + "Sending Intermediate Message back .... ");
252 sendIntermediateMessage();
254 if (responseAction.getRetry() != null && Integer.parseInt(responseAction.getRetry()) > retry ) {
255 log.debug(fn + "Ooppss!!! We will retry again ....... ");
258 log.debug(fn + "key =" + key + "retry =" + retry);
260 if (responseAction.isIgnore()) {
261 log.debug(fn + "Ignoring this Error and moving ahead ....... ");
264 if (responseAction.isStop()) {
265 log.debug(fn + "Need to Stop ....... ");
268 if (responseAction.getJump() != null && Integer.parseInt(responseAction.getJump()) > 0 ) {
269 key = Integer.parseInt(responseAction.getJump());
272 log.debug(fn + "key =" + key + "retry =" + retry);
275 throw new Exception("Don't know how to execute transaction ID " + transaction.getTransactionId());
281 private void sendIntermediateMessage() {
282 // TODO Auto-generated method stub
285 private ResponseAction handleResponse(Transaction transaction) {
286 log.info("Handling Response for transaction Id " + transaction.getTransactionId());
287 DefaultResponseHandler defaultHandler = new DefaultResponseHandler();
288 return defaultHandler.handlerResponse(transaction);
291 private boolean preProcessor(HashMap<Integer, Transaction> transactionMap, Transaction transaction)
294 log.debug("Starting Preprocessing Logic ");
295 boolean runthisStep = false;
297 if (transaction.getPrecheck() != null
298 && transaction.getPrecheck().getPrecheckOptions() != null
299 && !transaction.getPrecheck().getPrecheckOptions().isEmpty()) {
301 List<PrecheckOption> precheckOptions = transaction.getPrecheck().getPrecheckOptions();
302 for (PrecheckOption precheck : precheckOptions) {
303 Transaction trans = transactionMap.get(precheck.getpTransactionID());
304 ObjectMapper mapper = new ObjectMapper();
305 log.info("Mapper= " + mapper.writeValueAsString(trans));
306 HashMap trmap = mapper.readValue(mapper.writeValueAsString(trans), HashMap.class);
307 if (trmap.get(precheck.getParamName()) != null
308 && ((String) trmap.get(precheck.getParamName())).equalsIgnoreCase(precheck.getParamValue())) {
314 if (("any").equalsIgnoreCase(transaction.getPrecheck().getPrecheckOperator()) && runthisStep) {
319 log.debug("No Pre check defined for transaction ID " + transaction.getTransactionId());
322 } catch(Exception e) {
323 log.error("Error occured when Preprocessing Logic ", e);
326 log.debug("Returing process current Transaction = " + runthisStep);
330 private HashMap<Integer, Transaction> createTransactionMap(String flowSequnce, SvcLogicContext localContext)
333 ObjectMapper mapper = new ObjectMapper();
334 Transactions transactions = mapper.readValue(flowSequnce,Transactions.class);
335 HashMap<Integer, Transaction> transMap = new HashMap<>();
336 for (Transaction transaction : transactions.getTransactions()) {
337 compileFlowDependencies(transaction, localContext);
338 //parse the Transactions Object and create records in process_flow_status table
339 //loadTransactionIntoStatus(transactions, ctx);
340 transMap.put(transaction.getTransactionId(), transaction);
345 private void compileFlowDependencies(Transaction transaction, SvcLogicContext localContext) throws Exception {
347 FlowControlDBService dbservice = FlowControlDBService.initialise();
348 dbservice.populateModuleAndRPC(transaction, localContext.getAttribute(FlowControllerConstants.VNF_TYPE));
349 ObjectMapper mapper = new ObjectMapper();
350 log.debug("Indivisual Transaction Details :" + transaction.toString());
352 if ((localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE) == null)
353 || (localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE) != null
354 && ! localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE)
355 .equalsIgnoreCase(FlowControllerConstants.DESINGTIME))) {
357 localContext.setAttribute("artifact-content", mapper.writeValueAsString(transaction));
358 dbservice.loadSequenceIntoDB(localContext);
360 //get a field in transction class as transactionhandle interface and register the Handler here for each trnactions
363 private String collectInputParams(SvcLogicContext ctx,Transaction transaction) throws Exception {
365 String fn = "FlowExecuteNode.collectInputParams";
366 Properties prop = loadProperties();
367 log.info("Loaded Properties " + prop.toString());
369 String vnfId = ctx.getAttribute(FlowControllerConstants.VNF_ID);
370 String inputData = null;
371 log.debug(fn + "vnfId :" + vnfId);
373 if (StringUtils.isBlank(vnfId)) {
374 throw new Exception("VnfId is missing");
378 ActionIdentifier actionIdentifier = new ActionIdentifier();
379 log.debug("Enter ActionIdentifier");
380 if (StringUtils.isNotBlank(vnfId)) {
381 actionIdentifier.setVnfId(vnfId);
383 if (StringUtils.isNotBlank(ctx.getAttribute(FlowControllerConstants.VSERVER_ID))) {
384 actionIdentifier.setVserverId(ctx.getAttribute(FlowControllerConstants.VSERVER_ID));
386 if (StringUtils.isNotBlank(ctx.getAttribute(FlowControllerConstants.VNFC_NAME))) {
387 actionIdentifier.setVnfcName(ctx.getAttribute(FlowControllerConstants.VNFC_NAME));
389 log.info("ActionIdentifierData" + actionIdentifier.toString());
391 RequestInfo requestInfo = new RequestInfo();
392 log.info("Enter RequestInfo");
393 requestInfo.setAction(ctx.getAttribute(FlowControllerConstants.REQUEST_ACTION));
394 requestInfo.setActionLevel(ctx.getAttribute(FlowControllerConstants.ACTION_LEVEL));
395 requestInfo.setPayload(ctx.getAttribute(FlowControllerConstants.PAYLOAD));
396 requestInfo.setActionIdentifier(actionIdentifier);
397 log.debug("RequestInfo: " + requestInfo.toString());
399 InventoryInfo inventoryInfo = getInventoryInfo(ctx, vnfId);
400 DependencyInfo dependencyInfo = getDependencyInfo(ctx);
401 Capabilities capabilites = getCapabilitesData(ctx);
403 Input input = new Input();
404 log.info("Enter InputData");
405 input.setRequestInfo(requestInfo);
406 input.setInventoryInfo(inventoryInfo);
407 input.setDependencyInfo(dependencyInfo);
408 input.setCapabilities(capabilites);
409 log.info(fn + "Input parameters:" + input.toString());
411 ObjectMapper mapper = new ObjectMapper();
412 mapper.setSerializationInclusion(Include.NON_NULL);
413 mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
414 inputData = mapper.writeValueAsString(input);
415 log.info("InputDataJson:" + inputData);
417 } catch (Exception e) {
418 log.error("Error occured in " + fn, e);
421 String resourceUri = prop.getProperty(FlowControllerConstants.SEQ_GENERATOR_URL);
422 log.info(fn + "resourceUri= " + resourceUri);
424 EncryptionTool et = EncryptionTool.getInstance();
425 String pass = et.decrypt(prop.getProperty(FlowControllerConstants.SEQ_GENERATOR_PWD));
427 transaction.setPayload(inputData);
428 transaction.setExecutionRPC("POST");
429 transaction.setuId(prop.getProperty(FlowControllerConstants.SEQ_GENERATOR_UID));
430 transaction.setPswd(pass);
431 transaction.setExecutionEndPoint(resourceUri);
436 private DependencyInfo getDependencyInfo(SvcLogicContext ctx) throws Exception {
438 String fn = "FlowExecutorNode.getDependencyInfo";
439 DependencyInfo dependencyInfo = new DependencyInfo();
440 FlowControlDBService dbservice = FlowControlDBService.initialise();
441 String dependencyData = dbservice.getDependencyInfo(ctx);
442 log.info(fn + "dependencyDataInput:" + dependencyData);
444 if (dependencyData != null) {
445 ObjectMapper mapper = new ObjectMapper();
446 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
447 mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
448 //JsonNode dependencyInfoData = mapper.readTree(dependencyData).get("dependencyInfo");
449 JsonNode vnfcData = mapper.readTree(dependencyData).get("vnfcs");
450 List<Vnfcs> vnfclist = Arrays.asList(mapper.readValue(vnfcData.toString(), Vnfcs[].class));
451 dependencyInfo.getVnfcs().addAll(vnfclist);
453 log.info("Dependency Output:" + dependencyInfo.toString());
455 return dependencyInfo;
458 private Capabilities getCapabilitesData(SvcLogicContext ctx) throws Exception {
460 String fn = "FlowExecutorNode.getCapabilitesData";
461 Capabilities capabilities = new Capabilities();
462 FlowControlDBService dbservice = FlowControlDBService.initialise();
463 String capabilitiesData = dbservice.getCapabilitiesData(ctx);
464 log.info(fn + "capabilitiesDataInput:" + capabilitiesData);
466 if (capabilitiesData != null) {
467 ObjectMapper mapper = new ObjectMapper();
468 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
469 mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
470 JsonNode capabilitiesNode = mapper.readValue(capabilitiesData,JsonNode.class);
471 log.info("capabilitiesNode:" + capabilitiesNode.toString());
473 JsonNode vnfs = capabilitiesNode.findValue(FlowControllerConstants.VNF);
474 List<String> vnfsList = new ArrayList<>();
476 for (int i = 0; i < vnfs.size(); i++) {
477 String vnf = vnfs.get(i).asText();
482 JsonNode vfModules = capabilitiesNode.findValue(FlowControllerConstants.VF_MODULE);
483 List<String> vfModulesList = new ArrayList<>();
484 if (vfModules != null) {
485 for (int i = 0; i < vfModules.size(); i++) {
486 String vfModule = vfModules.get(i).asText();
487 vfModulesList.add(vfModule);
491 JsonNode vnfcs = capabilitiesNode.findValue(FlowControllerConstants.VNFC);
492 List<String> vnfcsList = new ArrayList<>();
494 for (int i = 0; i < vnfcs.size(); i++) {
495 String vnfc1 = vnfcs.get(i).asText();
496 vnfcsList.add(vnfc1);
500 JsonNode vms = capabilitiesNode.findValue(FlowControllerConstants.VM);
501 List<String> vmList = new ArrayList<>();
503 for (int i = 0; i < vms.size(); i++) {
504 String vm1 = vms.get(i).asText();
509 capabilities.getVnfc().addAll(vnfcsList);
510 capabilities.getVnf().addAll(vnfsList);
511 capabilities.getVfModule().addAll(vfModulesList);
512 capabilities.getVm().addAll(vmList);
514 log.info("Capabilities Output:" + capabilities.toString());
519 private InventoryInfo getInventoryInfo(SvcLogicContext ctx, String vnfId) throws Exception {
520 String fn = "FlowExecutorNode.getInventoryInfo";
522 VnfInfo vnfInfo = new VnfInfo();
523 vnfInfo.setVnfId(vnfId);
524 vnfInfo.setVnfName(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-name"));
525 vnfInfo.setVnfType(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-type"));
527 String vmcount = ctx.getAttribute("tmp.vnfInfo.vm-count");
528 if (StringUtils.isNotBlank(vmcount)) {
529 int vmCount = Integer.parseInt(vmcount);
530 log.info(fn + "vmcount:" + vmCount);
533 Vnfcslist vnfc = new Vnfcslist();
534 for (int i = 0; i < vmCount; i++) {
535 vm.setVserverId(ctx.getAttribute("tmp.vnfInfo.vm[" + i + "].vserver-id"));
536 String vnfccount = ctx.getAttribute("tmp.vnfInfo.vm[" + i + "].vnfc-count");
537 int vnfcCount = Integer.parseInt(vnfccount);
539 vnfc.setVnfcName(ctx.getAttribute("tmp.vnfInfo.vm[" + i + "].vnfc-name"));
540 vnfc.setVnfcType(ctx.getAttribute("tmp.vnfInfo.vm[" + i + "].vnfc-type"));
543 vnfInfo.getVm().add(vm);
546 InventoryInfo inventoryInfo = new InventoryInfo();
547 inventoryInfo.setVnfInfo(vnfInfo);
548 log.info(fn + "Inventory Output:" + inventoryInfo.toString());
550 return inventoryInfo;
553 private static Properties loadProperties() throws Exception {
554 Properties props = new Properties();
555 String propDir = System.getenv(SDNC_CONFIG_DIR_VAR);
556 if (propDir == null) {
557 throw new Exception("Cannot find Property file -" + SDNC_CONFIG_DIR_VAR);
559 String propFile = propDir + FlowControllerConstants.APPC_FLOW_CONTROLLER;
560 try (InputStream propStream = new FileInputStream(propFile)) {
562 props.load(propStream);
564 } catch (Exception e) {
565 throw new Exception("Could not load properties file " + propFile, e);