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.
18 * ============LICENSE_END=========================================================
21 package org.onap.appc.flow.controller.node;
23 import java.io.FileInputStream;
24 import java.io.IOException;
25 import java.io.InputStream;
26 import java.nio.charset.Charset;
27 import java.util.ArrayList;
28 import java.util.Arrays;
29 import java.util.HashMap;
30 import java.util.List;
32 import java.util.Properties;
33 import org.json.JSONObject;
35 import org.apache.commons.io.IOUtils;
36 import org.apache.commons.lang3.StringUtils;
37 import org.onap.appc.flow.controller.ResponseHandlerImpl.DefaultResponseHandler;
38 import org.onap.appc.flow.controller.data.PrecheckOption;
39 import org.onap.appc.flow.controller.data.ResponseAction;
40 import org.onap.appc.flow.controller.data.Transaction;
41 import org.onap.appc.flow.controller.data.Transactions;
42 import org.onap.appc.flow.controller.dbervices.FlowControlDBService;
43 import org.onap.appc.flow.controller.executorImpl.GraphExecutor;
44 import org.onap.appc.flow.controller.executorImpl.NodeExecutor;
45 import org.onap.appc.flow.controller.executorImpl.RestExecutor;
46 import org.onap.appc.flow.controller.interfaceData.ActionIdentifier;
47 import org.onap.appc.flow.controller.interfaceData.Capabilities;
48 import org.onap.appc.flow.controller.interfaceData.DependencyInfo;
49 import org.onap.appc.flow.controller.interfaceData.Input;
50 import org.onap.appc.flow.controller.interfaceData.InventoryInfo;
51 import org.onap.appc.flow.controller.interfaceData.RequestInfo;
52 import org.onap.appc.flow.controller.interfaceData.Vm;
53 import org.onap.appc.flow.controller.interfaceData.VnfInfo;
54 import org.onap.appc.flow.controller.interfaceData.Vnfcs;
55 import org.onap.appc.flow.controller.interfaceData.Vnfcslist;
56 import org.onap.appc.flow.controller.interfaces.FlowExecutorInterface;
57 import org.onap.appc.flow.controller.utils.EncryptionTool;
58 import org.onap.appc.flow.controller.utils.FlowControllerConstants;
59 import org.onap.ccsdk.sli.core.sli.SvcLogicContext;
60 import org.onap.ccsdk.sli.core.sli.SvcLogicException;
61 import org.onap.ccsdk.sli.core.sli.SvcLogicJavaPlugin;
63 import com.att.eelf.configuration.EELFLogger;
64 import com.att.eelf.configuration.EELFManager;
65 import com.fasterxml.jackson.annotation.JsonInclude.Include;
66 import com.fasterxml.jackson.core.JsonParseException;
67 import com.fasterxml.jackson.databind.DeserializationFeature;
68 import com.fasterxml.jackson.databind.JsonMappingException;
69 import com.fasterxml.jackson.databind.JsonNode;
70 import com.fasterxml.jackson.databind.ObjectMapper;
71 import com.fasterxml.jackson.databind.SerializationFeature;
73 public class FlowControlNode implements SvcLogicJavaPlugin{
76 private static final EELFLogger log = EELFManager.getInstance().getLogger(FlowControlNode.class);
77 private static final String SDNC_CONFIG_DIR_VAR = "SDNC_CONFIG_DIR";
79 public void processFlow(Map<String, String> inParams, SvcLogicContext ctx) throws SvcLogicException {
80 log.debug("Received processParamKeys call with params : " + inParams);
81 String responsePrefix = inParams.get(FlowControllerConstants.INPUT_PARAM_RESPONSE_PRIFIX);
84 responsePrefix = StringUtils.isNotBlank(responsePrefix) ? (responsePrefix+".") : "";
85 FlowControlDBService dbservice = FlowControlDBService.initialise();
86 SvcLogicContext localContext = new SvcLogicContext();
87 localContext.setAttribute(FlowControllerConstants.REQUEST_ID, ctx.getAttribute(FlowControllerConstants.REQUEST_ID));
88 localContext.setAttribute(FlowControllerConstants.VNF_TYPE, ctx.getAttribute(FlowControllerConstants.VNF_TYPE));
89 localContext.setAttribute(FlowControllerConstants.REQUEST_ACTION, ctx.getAttribute(FlowControllerConstants.REQUEST_ACTION));
90 localContext.setAttribute(FlowControllerConstants.ACTION_LEVEL, ctx.getAttribute(FlowControllerConstants.ACTION_LEVEL));
91 localContext.setAttribute(FlowControllerConstants.RESPONSE_PREFIX, responsePrefix);
92 ctx.setAttribute(FlowControllerConstants.RESPONSE_PREFIX, responsePrefix);
93 dbservice.getFlowReferenceData(ctx, inParams, localContext);
95 for (Object key : localContext.getAttributeKeySet()) {
96 String parmName = (String) key;
97 String parmValue = ctx.getAttribute(parmName);
98 log.debug("processFlow " + parmName + "=" + parmValue);
101 processFlowSequence(inParams, ctx, localContext);
102 if(!ctx.getAttribute(responsePrefix + FlowControllerConstants.OUTPUT_PARAM_STATUS).equals(FlowControllerConstants.OUTPUT_STATUS_SUCCESS))
103 throw new SvcLogicException(ctx.getAttribute(responsePrefix + FlowControllerConstants.OUTPUT_STATUS_MESSAGE));
105 } catch (Exception e) {
106 ctx.setAttribute(responsePrefix + FlowControllerConstants.OUTPUT_PARAM_STATUS, FlowControllerConstants.OUTPUT_STATUS_FAILURE);
107 ctx.setAttribute(responsePrefix + FlowControllerConstants.OUTPUT_PARAM_ERROR_MESSAGE, e.getMessage());
109 throw new SvcLogicException(e.getMessage());
113 private void processFlowSequence( Map<String, String> inParams, SvcLogicContext ctx, SvcLogicContext localContext) throws Exception
115 String fn = "FlowExecutorNode.processflowSequence";
116 log.debug(fn + "Received model for flow : " + localContext.toString());
117 FlowControlDBService dbservice = FlowControlDBService.initialise();
118 String flowSequnce =null;
119 for (Object key : localContext.getAttributeKeySet()) {
120 String parmName = (String) key;
121 String parmValue = ctx.getAttribute(parmName);
122 log.debug(parmName + "=" + parmValue);
125 if(localContext != null && localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE) !=null){
127 if(localContext.getAttribute(FlowControllerConstants.GENERATION_NODE) != null){
128 GraphExecutor transactionExecutor = new GraphExecutor();
129 Boolean generatorExists = transactionExecutor.hasGraph("APPC_COMMOM", localContext.getAttribute(FlowControllerConstants.GENERATION_NODE), null, "sync");
131 flowSequnce = transactionExecutor.executeGraph("APPC_COMMOM", localContext.getAttribute(FlowControllerConstants.GENERATION_NODE),
132 null, "sync", null).getProperty(FlowControllerConstants.FLOW_SEQUENCE);
135 throw new Exception("Can not find Custom defined Flow Generator for " + localContext.getAttribute(FlowControllerConstants.GENERATION_NODE));
137 else if(((String) localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE)).equalsIgnoreCase(FlowControllerConstants.DESINGTIME)){
138 localContext.setAttribute(FlowControllerConstants.VNFC_TYPE, ctx.getAttribute(FlowControllerConstants.VNFC_TYPE));
139 flowSequnce = dbservice.getDesignTimeFlowModel(localContext);
140 if(flowSequnce == null)
141 throw new Exception("Flow Sequence is not found User Desinged VNF " + ctx.getAttribute(FlowControllerConstants.VNF_TYPE));
143 else if(((String) localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE)).equalsIgnoreCase(FlowControllerConstants.RUNTIME)){
145 Transaction transaction = new Transaction();
146 String input = collectInputParams(ctx,transaction);
147 log.info("CollectInputParamsData-Input: " + input );
149 RestExecutor restExe = new RestExecutor();
150 HashMap<String,String>flowSeq= restExe.execute(transaction, localContext);
152 JSONObject sequence=new JSONObject(flowSeq.get("restResponse"));
153 if(sequence.has("output"))
154 flowSequnce = sequence.getJSONObject("output").toString();
155 log.info("MultistepSequenceGenerator-Output: "+flowSequnce);
157 if(flowSequnce == null)
158 throw new Exception("Failed to get the Flow Sequece runtime for VNF type" + ctx.getAttribute(FlowControllerConstants.VNF_TYPE));
161 else if(((String) localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE)).equalsIgnoreCase(FlowControllerConstants.EXTERNAL)){
162 //String input = collectInputParams(localContext);
163 // flowSequnce = ""; //get it from the External interface calling the Rest End point - TBD
164 if(flowSequnce == null)
165 throw new Exception("Flow Sequence not found for " + ctx.getAttribute(FlowControllerConstants.VNF_TYPE));
169 //No other type of model supported...in Future can get flowModel from other generators which will be included here
170 throw new Exception("No information found for sequence Owner Design-Time Vs Run-Time" );
174 FlowGenerator flowGenerator = new FlowGenerator();
175 Transactions trans = flowGenerator.createSingleStepModel(inParams,ctx);
176 ObjectMapper mapper = new ObjectMapper();
177 flowSequnce = mapper.writeValueAsString(trans);
178 log.debug("Single step Flow Sequence : " + flowSequnce);
181 log.debug("Received Flow Sequence : " + flowSequnce);
183 HashMap<Integer, Transaction> transactionMap = createTransactionMap(flowSequnce, localContext);
184 exeuteAllTransaction(transactionMap, ctx);
185 log.info("Executed all the transacstion successfully");
189 private void exeuteAllTransaction(HashMap<Integer, Transaction> transactionMap, SvcLogicContext ctx) throws Exception {
191 String fn = "FlowExecutorNode.exeuteAllTransaction ";
193 FlowExecutorInterface flowExecutor = null;
194 for (int key = 1; key <= transactionMap.size() ; key++ )
196 log.debug(fn + "Starting transactions ID " + key + " :)=" + retry);
197 Transaction transaction = transactionMap.get(key);
198 if(!preProcessor(transactionMap, transaction)){
199 log.info("Skipping Transaction ID " + transaction.getTransactionId());
202 if(transaction.getExecutionType() != null){
203 switch (transaction.getExecutionType()){
204 case FlowControllerConstants.GRAPH :
205 flowExecutor = new GraphExecutor();
207 case FlowControllerConstants.NODE :
208 flowExecutor = new NodeExecutor();
210 case FlowControllerConstants.REST :
211 flowExecutor = new RestExecutor();
214 throw new Exception("No Executor found for transaction ID" + transaction.getTransactionId());
216 flowExecutor.execute(transaction, ctx);
217 ResponseAction responseAction= handleResponse(transaction);
219 if(responseAction.getWait() != null && Integer.parseInt(responseAction.getWait()) > 0){
220 log.debug(fn + "Going to Sleep .... " + responseAction.getWait());
221 Thread.sleep(Integer.parseInt(responseAction.getWait())*1000);
224 if(responseAction.isIntermediateMessage()){
225 log.debug(fn + "Sending Intermediate Message back .... ");
226 sendIntermediateMessage();
228 if(responseAction.getRetry() != null && Integer.parseInt(responseAction.getRetry()) > retry ){
229 log.debug(fn + "Ooppss!!! We will retry again ....... ");
232 log.debug(fn + "key =" + key + "retry =" + retry);
235 if(responseAction.isIgnore()){
236 log.debug(fn + "Ignoring this Error and moving ahead ....... ");
239 if(responseAction.isStop()){
240 log.debug(fn + "Need to Stop ....... ");
243 if(responseAction.getJump() != null && Integer.parseInt(responseAction.getJump()) > 0 ){
244 key = Integer.parseInt(responseAction.getJump());
247 log.debug(fn + "key =" + key + "retry =" + retry);
251 throw new Exception("Don't know how to execute transaction ID " + transaction.getTransactionId());
256 private void sendIntermediateMessage() {
257 // TODO Auto-generated method stub
261 private ResponseAction handleResponse(Transaction transaction) {
262 log.info("Handling Response for transaction Id " + transaction.getTransactionId());
263 DefaultResponseHandler defaultHandler = new DefaultResponseHandler();
264 return defaultHandler.handlerResponse(transaction);
267 private boolean preProcessor(HashMap<Integer, Transaction> transactionMap, Transaction transaction) throws IOException {
269 log.debug("Starting Preprocessing Logic ");
270 boolean runthisStep = false;
272 if(transaction.getPrecheck() != null && transaction.getPrecheck().getPrecheckOptions() != null
273 && !transaction.getPrecheck().getPrecheckOptions().isEmpty()){
274 List<PrecheckOption> precheckOptions = transaction.getPrecheck().getPrecheckOptions();
275 for(PrecheckOption precheck : precheckOptions){
276 Transaction trans = transactionMap.get(precheck.getpTransactionID());
277 ObjectMapper mapper = new ObjectMapper();
278 log.info("Mapper= " + mapper.writeValueAsString(trans));
279 HashMap<Object, Object> trmap = mapper.readValue(mapper.writeValueAsString(trans), HashMap.class);
280 if(trmap.get(precheck.getParamName()) != null &&
281 ((String) trmap.get(precheck.getParamName())).equalsIgnoreCase(precheck.getParamValue()))
286 if(transaction.getPrecheck().getPrecheckOperator() != null &&
287 transaction.getPrecheck().getPrecheckOperator().equalsIgnoreCase("any") && runthisStep)
293 log.debug("No Pre check defined for transaction ID " + transaction.getTransactionId());
303 log.debug("Returing process current Transaction = " + runthisStep);
308 private HashMap<Integer, Transaction> createTransactionMap(String flowSequnce, SvcLogicContext localContext) throws Exception {
309 ObjectMapper mapper = new ObjectMapper();
310 Transactions transactions = mapper.readValue(flowSequnce,Transactions.class);
311 HashMap<Integer, Transaction> transMap = new HashMap<Integer, Transaction>();
312 for(Transaction transaction : transactions.getTransactions()){
313 compileFlowDependencies(transaction, localContext);
314 //loadTransactionIntoStatus(transactions, ctx); //parse the Transactions Object and create records in process_flow_status table
315 transMap.put(transaction.getTransactionId(), transaction);
320 private void compileFlowDependencies(Transaction transaction, SvcLogicContext localContext) throws Exception {
322 String fn = "FlowExecutorNode.compileFlowDependencies";
323 FlowControlDBService dbservice = FlowControlDBService.initialise();
324 dbservice.populateModuleAndRPC(transaction, localContext.getAttribute(FlowControllerConstants.VNF_TYPE));
325 ObjectMapper mapper = new ObjectMapper();
326 log.debug("Indivisual Transaction Details :" + transaction.toString());
327 if((localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE) == null) ||
328 ( localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE) != null &&
329 ! localContext.getAttribute(FlowControllerConstants.SEQUENCE_TYPE).equalsIgnoreCase(FlowControllerConstants.DESINGTIME))){
330 localContext.setAttribute("artifact-content", mapper.writeValueAsString(transaction));
331 dbservice.loadSequenceIntoDB(localContext);
333 //get a field in transction class as transactionhandle interface and register the Handler here for each trnactions
336 private String collectInputParams(SvcLogicContext ctx,Transaction transaction) throws Exception {
338 String fn = "FlowExecuteNode.collectInputParams";
339 Properties prop = loadProperties();
340 log.info("Loaded Properties " + prop.toString());
342 String vnfId = ctx.getAttribute(FlowControllerConstants.VNF_ID);
343 String inputData = null;
344 log.debug(fn + "vnfId :" + vnfId);
346 if (StringUtils.isBlank(vnfId)) {
347 throw new Exception("VnfId is missing");
352 ActionIdentifier actionIdentifier = new ActionIdentifier();
353 log.debug("Enter ActionIdentifier");
354 if (StringUtils.isNotBlank(vnfId)) {
355 actionIdentifier.setVnfId(vnfId);
357 if (StringUtils.isNotBlank(ctx.getAttribute(FlowControllerConstants.VSERVER_ID))) {
358 actionIdentifier.setVserverId(ctx.getAttribute(FlowControllerConstants.VSERVER_ID));
360 if (StringUtils.isNotBlank(ctx.getAttribute(FlowControllerConstants.VNFC_NAME))) {
361 actionIdentifier.setVnfcName(ctx.getAttribute(FlowControllerConstants.VNFC_NAME));
363 log.info("ActionIdentifierData" + actionIdentifier.toString());
365 RequestInfo requestInfo = new RequestInfo();
366 log.info("Enter RequestInfo");
367 requestInfo.setAction(ctx.getAttribute(FlowControllerConstants.REQUEST_ACTION));
368 requestInfo.setActionLevel(ctx.getAttribute(FlowControllerConstants.ACTION_LEVEL));
369 requestInfo.setPayload(ctx.getAttribute(FlowControllerConstants.PAYLOAD));
370 requestInfo.setActionIdentifier(actionIdentifier);
371 log.debug("RequestInfo: " + requestInfo.toString());
373 InventoryInfo inventoryInfo = getInventoryInfo(ctx, vnfId);
374 DependencyInfo dependencyInfo = getDependencyInfo(ctx);
375 Capabilities capabilites = getCapabilitesData(ctx);
377 Input input = new Input();
378 log.info("Enter InputData");
379 input.setRequestInfo(requestInfo);
380 input.setInventoryInfo(inventoryInfo);
381 input.setDependencyInfo(dependencyInfo);
382 input.setCapabilities(capabilites);
383 log.info(fn + "Input parameters:" + input.toString());
385 ObjectMapper mapper = new ObjectMapper();
386 mapper.setSerializationInclusion(Include.NON_NULL);
387 mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, true);
388 inputData = mapper.writeValueAsString(input);
389 log.info("InputDataJson:" + inputData);
391 } catch (Exception e) {
395 String resourceUri = prop.getProperty(FlowControllerConstants.SEQ_GENERATOR_URL);
396 log.info(fn + "resourceUri= " + resourceUri);
398 EncryptionTool et = EncryptionTool.getInstance();
399 String pass = et.decrypt(prop.getProperty(FlowControllerConstants.SEQ_GENERATOR_PWD));
401 transaction.setPayload(inputData);
402 transaction.setExecutionRPC("POST");
403 transaction.setuId(prop.getProperty(FlowControllerConstants.SEQ_GENERATOR_UID));
404 transaction.setPswd(pass);
405 transaction.setExecutionEndPoint(resourceUri);
411 private DependencyInfo getDependencyInfo(SvcLogicContext ctx) throws Exception {
413 String fn = "FlowExecutorNode.getDependencyInfo";
414 DependencyInfo dependencyInfo = new DependencyInfo();
415 FlowControlDBService dbservice = FlowControlDBService.initialise();
416 String dependencyData = dbservice.getDependencyInfo(ctx);
417 log.info(fn + "dependencyDataInput:" + dependencyData);
419 if (dependencyData != null) {
420 ObjectMapper mapper = new ObjectMapper();
421 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
422 mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
423 //JsonNode dependencyInfoData = mapper.readTree(dependencyData).get("dependencyInfo");
424 JsonNode vnfcData = mapper.readTree(dependencyData.toString()).get("vnfcs");
425 List<Vnfcs> vnfclist = Arrays.asList(mapper.readValue(vnfcData.toString(), Vnfcs[].class));
426 dependencyInfo.getVnfcs().addAll(vnfclist);
428 log.info("Dependency Output:"+ dependencyInfo.toString());
431 return dependencyInfo;
435 private Capabilities getCapabilitesData(SvcLogicContext ctx)throws Exception {
437 String fn = "FlowExecutorNode.getCapabilitesData";
438 Capabilities capabilities = new Capabilities();
439 FlowControlDBService dbservice = FlowControlDBService.initialise();
440 String capabilitiesData = dbservice.getCapabilitiesData(ctx);
441 log.info(fn + "capabilitiesDataInput:" + capabilitiesData);
443 if (capabilitiesData != null) {
444 ObjectMapper mapper = new ObjectMapper();
445 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES,false);
446 mapper.enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY);
447 JsonNode capabilitiesNode = mapper.readValue(capabilitiesData,JsonNode.class);
448 log.info("capabilitiesNode:" + capabilitiesNode.toString());
450 JsonNode vnfs = capabilitiesNode.findValue(FlowControllerConstants.VNF);
451 List<String> vnfsList = new ArrayList<String>();
453 for (int i = 0; i < vnfs.size(); i++) {
455 String vnf = vnfs.get(i).asText();
460 JsonNode vfModules = capabilitiesNode.findValue(FlowControllerConstants.VF_MODULE);
461 List<String> vfModulesList = new ArrayList<String>();
462 if (vfModules != null) {
463 for (int i = 0; i < vfModules.size(); i++) {
465 String vfModule = vfModules.get(i).asText();
466 vfModulesList.add(vfModule);
470 JsonNode vnfcs = capabilitiesNode.findValue(FlowControllerConstants.VNFC);
471 List<String> vnfcsList = new ArrayList<String>();
473 for (int i = 0; i < vnfcs.size(); i++) {
475 String vnfc1 = vnfcs.get(i).asText();
476 vnfcsList.add(vnfc1);
480 JsonNode vms = capabilitiesNode.findValue(FlowControllerConstants.VM);
482 List<String> vmList = new ArrayList<String>();
484 for (int i = 0; i < vms.size(); i++) {
486 String vm1 = vms.get(i).asText();
491 capabilities.getVnfc().addAll(vnfcsList);
492 capabilities.getVnf().addAll(vnfsList);
493 capabilities.getVfModule().addAll(vfModulesList);
494 capabilities.getVm().addAll(vmList);
496 log.info("Capabilities Output:"+ capabilities.toString());
504 private InventoryInfo getInventoryInfo(SvcLogicContext ctx, String vnfId) throws Exception{
506 String fn = "FlowExecutorNode.getInventoryInfo";
508 VnfInfo vnfInfo = new VnfInfo();
509 vnfInfo.setVnfId(vnfId);
510 vnfInfo.setVnfName(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-name"));
511 vnfInfo.setVnfType(ctx.getAttribute("tmp.vnfInfo.vnf.vnf-type"));
513 String vmcount = ctx.getAttribute("tmp.vnfInfo.vm-count");
514 if(StringUtils.isNotBlank(vmcount)){
515 int vmCount = Integer.parseInt(vmcount);
516 log.info(fn +"vmcount:"+ vmCount);
519 Vnfcslist vnfc = new Vnfcslist();
523 for (int i = 0; i < vmCount; i++) {
525 vm.setVserverId(ctx.getAttribute("tmp.vnfInfo.vm[" + i + "].vserver-id"));
526 String vnfccount = ctx.getAttribute("tmp.vnfInfo.vm[" + i + "].vnfc-count");
527 int vnfcCount = Integer.parseInt(vnfccount);
530 vnfc.setVnfcName(ctx.getAttribute("tmp.vnfInfo.vm[" + i + "].vnfc-name"));
531 vnfc.setVnfcType(ctx.getAttribute("tmp.vnfInfo.vm[" + i + "].vnfc-type"));
534 vnfInfo.getVm().add(vm);
538 InventoryInfo inventoryInfo = new InventoryInfo();
539 inventoryInfo.setVnfInfo(vnfInfo);
540 log.info(fn + "Inventory Output:" +inventoryInfo.toString());
542 return inventoryInfo;
546 private String getFlowSequence() throws IOException {
548 String sequenceModel = IOUtils.toString(FlowControlNode.class.getClassLoader().getResourceAsStream("sequence.json"), Charset.defaultCharset());
554 private static Properties loadProperties() throws Exception {
555 Properties props = new Properties();
556 String propDir = System.getenv(SDNC_CONFIG_DIR_VAR);
558 throw new Exception("Cannot find Property file -" + SDNC_CONFIG_DIR_VAR);
559 String propFile = propDir + FlowControllerConstants.APPC_FLOW_CONTROLLER;
560 InputStream propStream = new FileInputStream(propFile);
563 props.load(propStream);
567 throw new Exception("Could not load properties file " + propFile, e);
577 log.warn("Could not close FileInputStream", e);