import org.apache.commons.lang3.*\r
import org.apache.commons.codec.binary.Base64;\r
import org.springframework.web.util.UriUtils;\r
+import static org.apache.commons.lang3.StringUtils.*\r
\r
/**\r
* This groovy class supports the <class>CreateVcpeResCustService.bpmn</class> process.\r
// initialize flow variables\r
InitializeProcessVariables(execution)\r
\r
+ //Config Inputs\r
+ String aaiDistDelay = execution.getVariable('URN_mso_workflow_aai_distribution_delay')\r
+ if (isBlank(aaiDistDelay)) {\r
+ msg = "URN_mso_workflow_aai_distribution_delay is null"\r
+ utils.log("DEBUG", msg, isDebugEnabled)\r
+ exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg)\r
+ }\r
+ execution.setVariable("aaiDistDelay", aaiDistDelay)\r
+ utils.log("DEBUG","AAI distribution delay: " + aaiDistDelay, isDebugEnabled)\r
+\r
// check for incoming json message/input\r
String createVcpeServiceRequest = execution.getVariable("bpmnRequest")\r
utils.logAudit(createVcpeServiceRequest)\r
\r
// VNFs\r
List<VnfResource> vnfList = serviceDecomposition.getServiceVnfs()\r
+ filterVnfs(vnfList)\r
+ serviceDecomposition.setServiceVnfs(vnfList)\r
+ \r
execution.setVariable("vnfList", vnfList)\r
execution.setVariable("vnfListString", vnfList.toString())\r
\r
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, exceptionMessage)\r
}\r
}\r
+ \r
+ private void filterVnfs(List<VnfResource> vnfList) {\r
+ if(vnfList == null) {\r
+ return\r
+ }\r
+ \r
+ // remove BRG & TXC from VNF list\r
+ \r
+ Iterator<VnfResource> it = vnfList.iterator()\r
+ while(it.hasNext()) {\r
+ VnfResource vr = it.next()\r
+ \r
+ String role = vr.getNfRole()\r
+ if(role == "BRG" || role == "TunnelXConn") {\r
+ it.remove()\r
+ }\r
+ }\r
+ }\r
\r
\r
public void prepareCreateAllottedResourceTXC(Execution execution) {\r