diff options
Diffstat (limited to 'bpmn')
14 files changed, 94 insertions, 42 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java index 054cc378ef..c6d92cc9ab 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/listener/flowmanipulator/FlowManipulatorListenerRunner.java @@ -60,6 +60,9 @@ public class FlowManipulatorListenerRunner extends ListenerRunner { int sequenceBeforeFlowManipulator; do { sequenceBeforeFlowManipulator = execution.getVariable(BBConstants.G_CURRENT_SEQUENCE); + if (sequenceBeforeFlowManipulator >= flowsToExecute.size()) { + break; + } ExecuteBuildingBlock currentBB = flowsToExecute.get(execution.getCurrentSequence()); List<PreFlowManipulator> filtered = filterListeners(flowManipulators, (item -> item.shouldRunFor(currentBB.getBuildingBlock().getBpmnFlowName(), diff --git a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn index 5fd9701880..6fb7b5b5b4 100644 --- a/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn +++ b/bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/WorkflowActionBB.bpmn @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.1.2"> +<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.6.0"> <bpmn:process id="WorkflowActionBB" name="WorkflowActionBB" isExecutable="true"> <bpmn:extensionElements> <camunda:executionListener class="org.onap.so.bpmn.core.plugins.AsyncTaskExecutorListener" event="end" /> @@ -30,7 +30,7 @@ <camunda:in source="rollbackTargetState" target="rollbackTargetState" /> <camunda:out source="rollbackTargetState" target="rollbackTargetState" /> </bpmn:extensionElements> - <bpmn:incoming>SequenceFlow_0mew9im</bpmn:incoming> + <bpmn:incoming>SequenceFlow_0duoleg</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1hsqed1</bpmn:outgoing> </bpmn:callActivity> <bpmn:sequenceFlow id="SequenceFlow_0mqrkxv" sourceRef="Task_SelectBB" targetRef="ServiceTask_0e2p0xs" /> @@ -183,7 +183,7 @@ <bpmn:incoming>SequenceFlow_0mqrkxv</bpmn:incoming> <bpmn:outgoing>SequenceFlow_0mew9im</bpmn:outgoing> </bpmn:serviceTask> - <bpmn:sequenceFlow id="SequenceFlow_0mew9im" sourceRef="ServiceTask_0e2p0xs" targetRef="Call_ExecuteBB" /> + <bpmn:sequenceFlow id="SequenceFlow_0mew9im" sourceRef="ServiceTask_0e2p0xs" targetRef="ExclusiveGateway_10j89d1" /> <bpmn:sequenceFlow id="SequenceFlow_0kf5sen" name="yes" sourceRef="ExclusiveGateway_isTopLevelFlowC" targetRef="Task_UpdateRequestComplete" /> <bpmn:sequenceFlow id="SequenceFlow_1tfizxf" sourceRef="Task_PreValidateWorkflow" targetRef="Task_SelectBB" /> <bpmn:serviceTask id="Task_PreValidateWorkflow" name="PreValidate Workflow" camunda:expression="${WorkflowValidatorRunner.preValidate(execution.getVariable("requestAction"), execution)}"> @@ -193,6 +193,7 @@ </bpmn:serviceTask> <bpmn:serviceTask id="ServiceTask_0lbkcyp" name="Post Processing Execute BB" camunda:expression="${WorkflowActionBBTasks.postProcessingExecuteBB(execution)}"> <bpmn:incoming>SequenceFlow_1hsqed1</bpmn:incoming> + <bpmn:incoming>SequenceFlow_1knplug</bpmn:incoming> <bpmn:outgoing>SequenceFlow_1fftixk</bpmn:outgoing> </bpmn:serviceTask> <bpmn:sequenceFlow id="SequenceFlow_1hsqed1" sourceRef="Call_ExecuteBB" targetRef="ServiceTask_0lbkcyp" /> @@ -211,6 +212,15 @@ <bpmn:incoming>SequenceFlow_0ilo6lo</bpmn:incoming> </bpmn:endEvent> <bpmn:sequenceFlow id="SequenceFlow_0ilo6lo" name="yes" sourceRef="ExclusiveGateway_1dez26n" targetRef="EndEvent_12f15tu" /> + <bpmn:exclusiveGateway id="ExclusiveGateway_10j89d1" default="SequenceFlow_0duoleg"> + <bpmn:incoming>SequenceFlow_0mew9im</bpmn:incoming> + <bpmn:outgoing>SequenceFlow_0duoleg</bpmn:outgoing> + <bpmn:outgoing>SequenceFlow_1knplug</bpmn:outgoing> + </bpmn:exclusiveGateway> + <bpmn:sequenceFlow id="SequenceFlow_0duoleg" sourceRef="ExclusiveGateway_10j89d1" targetRef="Call_ExecuteBB" /> + <bpmn:sequenceFlow id="SequenceFlow_1knplug" name="completed = true" sourceRef="ExclusiveGateway_10j89d1" targetRef="ServiceTask_0lbkcyp"> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("completed")==true}</bpmn:conditionExpression> + </bpmn:sequenceFlow> </bpmn:process> <bpmn:error id="Error_0kd2o2a" name="java.lang.Exception" errorCode="java.lang.Exception" /> <bpmndi:BPMNDiagram id="BPMNDiagram_1"> @@ -235,11 +245,11 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="CallActivity_03m7z4y_di" bpmnElement="Call_ExecuteBB"> - <dc:Bounds x="1150" y="356" width="100" height="80" /> + <dc:Bounds x="1200" y="356" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0mqrkxv_di" bpmnElement="SequenceFlow_0mqrkxv"> <di:waypoint x="929" y="396" /> - <di:waypoint x="990" y="396" /> + <di:waypoint x="960" y="396" /> <bpmndi:BPMNLabel> <dc:Bounds x="324.5" y="105" width="90" height="0" /> </bpmndi:BPMNLabel> @@ -531,11 +541,11 @@ </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNShape id="ServiceTask_0e2p0xs_di" bpmnElement="ServiceTask_0e2p0xs"> - <dc:Bounds x="990" y="356" width="100" height="80" /> + <dc:Bounds x="960" y="356" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_0mew9im_di" bpmnElement="SequenceFlow_0mew9im"> - <di:waypoint x="1090" y="396" /> - <di:waypoint x="1150" y="396" /> + <di:waypoint x="1060" y="396" /> + <di:waypoint x="1105" y="396" /> <bpmndi:BPMNLabel> <dc:Bounds x="530" y="99" width="0" height="12" /> </bpmndi:BPMNLabel> @@ -561,17 +571,17 @@ <dc:Bounds x="670" y="356" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNShape id="ServiceTask_0lbkcyp_di" bpmnElement="ServiceTask_0lbkcyp"> - <dc:Bounds x="1325" y="356" width="100" height="80" /> + <dc:Bounds x="1350" y="356" width="100" height="80" /> </bpmndi:BPMNShape> <bpmndi:BPMNEdge id="SequenceFlow_1hsqed1_di" bpmnElement="SequenceFlow_1hsqed1"> - <di:waypoint x="1250" y="396" /> - <di:waypoint x="1325" y="396" /> + <di:waypoint x="1300" y="396" /> + <di:waypoint x="1350" y="396" /> <bpmndi:BPMNLabel> <dc:Bounds x="697.5" y="99" width="0" height="12" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> <bpmndi:BPMNEdge id="SequenceFlow_1fftixk_di" bpmnElement="SequenceFlow_1fftixk"> - <di:waypoint x="1425" y="396" /> + <di:waypoint x="1450" y="396" /> <di:waypoint x="1501" y="396" /> <bpmndi:BPMNLabel> <dc:Bounds x="873" y="99" width="0" height="12" /> @@ -618,6 +628,25 @@ <dc:Bounds x="727" y="173" width="18" height="14" /> </bpmndi:BPMNLabel> </bpmndi:BPMNEdge> + <bpmndi:BPMNShape id="ExclusiveGateway_10j89d1_di" bpmnElement="ExclusiveGateway_10j89d1" isMarkerVisible="true"> + <dc:Bounds x="1105" y="371" width="50" height="50" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1100" y="428" width="60" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNShape> + <bpmndi:BPMNEdge id="SequenceFlow_0duoleg_di" bpmnElement="SequenceFlow_0duoleg"> + <di:waypoint x="1155" y="396" /> + <di:waypoint x="1200" y="396" /> + </bpmndi:BPMNEdge> + <bpmndi:BPMNEdge id="SequenceFlow_1knplug_di" bpmnElement="SequenceFlow_1knplug"> + <di:waypoint x="1130" y="371" /> + <di:waypoint x="1130" y="330" /> + <di:waypoint x="1400" y="330" /> + <di:waypoint x="1400" y="356" /> + <bpmndi:BPMNLabel> + <dc:Bounds x="1224" y="312" width="83" height="14" /> + </bpmndi:BPMNLabel> + </bpmndi:BPMNEdge> </bpmndi:BPMNPlane> </bpmndi:BPMNDiagram> </bpmn:definitions> diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AllocateSliceSubnet.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AllocateSliceSubnet.groovy index 78cafa7be5..1e65c1a9dd 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AllocateSliceSubnet.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AllocateSliceSubnet.groovy @@ -114,7 +114,7 @@ class AllocateSliceSubnet extends AbstractServiceTaskProcessor { exceptionUtil.buildAndThrowWorkflowException(execution, 500, msg) } else { - execution.setVariable("networkType", networkType.toUpperCase()) + execution.setVariable("networkType", networkType.toLowerCase()) } //requestParameters, subscriptionServiceType is 5G diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy index bb6fe212b3..c7302d001c 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCommunicationService.groovy @@ -395,6 +395,10 @@ class CreateCommunicationService extends AbstractServiceTaskProcessor { e2eInputMap.put("dLThptPerSlice", dLThptPerSlice) e2eInputMap.put("uLThptPerSlice", uLThptPerSlice) e2eInputMap.put("maxNumberofConns", maxNumberofConns) + //TODO temp solution - service to slice profile mapping + e2eInputMap.put("expDataRateDL", dLThptPerSlice) + e2eInputMap.put("expDataRateUL", uLThptPerSlice) + e2eInputMap.put("maxNumberofPDUSession", maxNumberofConns) execution.setVariable("e2eInputMap", e2eInputMap) execution.setVariable("e2eServiceType", e2eServiceDecomposition.getServiceType()) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCommunicationService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCommunicationService.groovy index d00f349690..a1acbb3377 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCommunicationService.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DeleteCommunicationService.groovy @@ -215,13 +215,15 @@ class DeleteCommunicationService extends AbstractServiceTaskProcessor { requestBody.replaceAll("\\s+", "") String msoKey = UrnPropertiesReader.getVariable("mso.msoKey", execution) - String basicAuth = UrnPropertiesReader.getVariable("mso.infra.endpoint.auth", execution) + String basicAuth = UrnPropertiesReader.getVariable("mso.adapters.po.auth", execution) + def authHeader = utils.getBasicAuth(basicAuth, msoKey) + // String basicAuthValue = utils.encrypt(basicAuth, msoKey) // String encodeString = utils.getBasicAuth(basicAuthValue, msoKey) HttpClient httpClient = getHttpClientFactory().newJsonClient(new URL(url), ONAPComponents.SO) // httpClient.addAdditionalHeader("Authorization", encodeString) - httpClient.addAdditionalHeader("Authorization", basicAuth) + httpClient.addAdditionalHeader("Authorization", authHeader) httpClient.addAdditionalHeader("Accept", "application/json") Response httpResponse = httpClient.delete(requestBody) handleNSSMFWFResponse(httpResponse, execution) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy index f3fca050a2..a4d503a86c 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy @@ -565,7 +565,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { List<String> snssaiList = execution.getVariable("snssaiList") String snssai = snssaiList.get(0) //ANServiceInstance.setEnvironmentContext(snssai) - ANServiceInstance.setEnvironmentContext("an") //Network Type + ANServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) //Network Type ANServiceInstance.setWorkloadContext("AN") //domain Type logger.debug("completed AN service instance build "+ ANServiceInstance.toString()) @@ -631,7 +631,8 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { ANServiceInstance.setServiceRole(serviceRole) List<String> snssaiList = execution.getVariable("snssaiList") String snssai = snssaiList.get(0) - ANServiceInstance.setEnvironmentContext(snssai) + //ANServiceInstance.setEnvironmentContext(snssai) + ANServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) String modelInvariantUuid = execution.getVariable("modelInvariantUuid") String modelUuid = execution.getVariable("modelUuid") ANServiceInstance.setModelInvariantId(modelInvariantUuid) @@ -651,7 +652,8 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { ANNFServiceInstance.setServiceRole(serviceRole) snssaiList = execution.getVariable("snssaiList") snssai = snssaiList.get(0) - ANNFServiceInstance.setEnvironmentContext(snssai) + //ANNFServiceInstance.setEnvironmentContext(snssai) + ANNFServiceInstance.setEnvironmentContext(execution.getVariable("networkType")) ANNFServiceInstance.setModelInvariantId(execution.getVariable("ANNF_modelInvariantUuid")) ANNFServiceInstance.setModelVersionId(execution.getVariable("ANNF_modelUuid")) ANNFServiceInstance.setWorkloadContext("AN_NF") @@ -923,7 +925,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor { JsonObject commonHeader = new JsonObject() JsonObject payload = new JsonObject() JsonObject payloadInput = new JsonObject() - commonHeader.addProperty("timeStamp",new Date(System.currentTimeMillis()).format("yyyy-MM-dd'T'HH:mm:ss.sss'Z'", TimeZone.getDefault())) + commonHeader.addProperty("timestamp",new Date(System.currentTimeMillis()).format("yyyy-MM-dd'T'HH:mm:ss.sss'Z'", TimeZone.getDefault())) commonHeader.addProperty("api-ver", "1.0") commonHeader.addProperty("originator-id", "testing") commonHeader.addProperty("request-id", requestId) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy index e4281045bd..0d64d7811b 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy @@ -127,6 +127,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ String serviceStatus = "deactivated" String modelInvariantUuid = sliceParams.getNSTInfo().invariantUUID String modelUuid = sliceParams.getNSTInfo().UUID + String serviceFunction = sliceParams.serviceProfile.get("resourceSharingLevel") sliceParams.setSuggestNsiId(sliceInstanceId) sliceParams.setSuggestNsiName(sliceInstanceName) @@ -144,6 +145,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ nsi.setModelVersionId(modelUuid) nsi.setServiceInstanceLocationId(serviceInstanceLocationid) nsi.setServiceRole(serviceRole) + nsi.setServiceFunction(serviceFunction) String msg try { @@ -263,7 +265,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter SliceTaskInfo<SliceProfileAdapter> sliceTaskInfo = sliceParams.anSliceTaskInfo sliceTaskInfo.setSliceInstanceId(serviceInstanceId) - String sliceProfileName = "an_" + sliceParams.serviceName + String sliceProfileName = "sliceprofile_an_" + sliceParams.serviceName // create slice profile ServiceInstance rspi = createSliceProfileInstance(sliceTaskInfo, sliceProfileName, oStatus) @@ -401,6 +403,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ allocateAnNssi.nsstId = sliceTaskInfo.NSSTInfo.UUID allocateAnNssi.nssiId = sliceTaskInfo.suggestNssiId allocateAnNssi.nssiName = "nssi_an" + execution.getVariable("sliceServiceInstanceName") + allocateAnNssi.scriptName = sliceTaskInfo.getScriptName() NsiInfo nsiInfo = new NsiInfo() nsiInfo.nsiId = sliceParams.suggestNsiId nsiInfo.nsiName = sliceParams.suggestNsiName @@ -458,7 +461,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter SliceTaskInfo<SliceProfileAdapter> sliceTaskInfo = sliceParams.cnSliceTaskInfo sliceTaskInfo.setSliceInstanceId(serviceInstanceId) - String sliceProfileName = "cn_"+sliceParams.serviceName + String sliceProfileName = "sliceprofile_cn_"+sliceParams.serviceName // create slice profile ServiceInstance rspi = createSliceProfileInstance(sliceTaskInfo, sliceProfileName, oStatus) @@ -544,6 +547,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ allocateCnNssi.nssiName = "nssi_cn" + execution.getVariable("sliceServiceInstanceName") allocateCnNssi.sliceProfile = sliceTaskInfo.sliceProfile.trans2CnProfile() allocateCnNssi.sliceProfile.sliceProfileId = sliceTaskInfo.sliceInstanceId + allocateCnNssi.scriptName = sliceTaskInfo.getScriptName() NsiInfo nsiInfo = new NsiInfo() nsiInfo.nsiId = sliceParams.suggestNsiId @@ -602,7 +606,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ String serviceInstanceId = UUID.randomUUID().toString() sliceTaskInfo.setSliceInstanceId(serviceInstanceId) - String sliceProfileName = "tn_" + sliceParams.serviceName + String sliceProfileName = "sliceprofile_tn_" + sliceParams.serviceName //execution.setVariable("cnSliceProfileInstanceId", serviceInstanceId) //todo: // create slice profile @@ -671,6 +675,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ AllocateTnNssi allocateTnNssi = new AllocateTnNssi() allocateTnNssi.setNssiId(sliceTaskInfo.suggestNssiId) + allocateTnNssi.scriptName = sliceTaskInfo.getScriptName() //todo: AllocateTnNssi //todo: endPointId -> set into tn List<TransportSliceNetwork> transportSliceNetworks = new ArrayList<>() @@ -943,6 +948,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ rspi.setModelVersionId(sliceTaskInfo.NSSTInfo.UUID) rspi.setWorkloadContext(sliceTaskInfo.subnetType.subnetType) rspi.setEnvironmentContext(sliceTaskInfo.sliceProfile.getSNSSAIList()) + rspi.setServiceFunction(sliceTaskInfo.sliceProfile.getResourceSharingLevel()) //timestamp format YYYY-MM-DD hh:mm:ss rspi.setCreatedAt(new Date(System.currentTimeMillis()).format("yyyy-MM-dd HH:mm:ss", TimeZone.getDefault())) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy index 8859af25f6..f6be861bde 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoModifyAccessNSSI.groovy @@ -388,12 +388,12 @@ class DoModifyAccessNSSI extends AbstractServiceTaskProcessor { Optional<org.onap.aai.domain.yang.LogicalLink> resource = wrapper01.asBean(org.onap.aai.domain.yang.LogicalLink.class) if (resource.isPresent()) { org.onap.aai.domain.yang.LogicalLink logicalLinkInstance = resource.get() - if(domainType.equalsIgnoreCase("TN-FH")) + if(domainType.equalsIgnoreCase("TN_FH")) { execution.setVariable("tranportEp_ID_RU",logicalLinkInstance.getLinkName()) execution.setVariable("tranportEp_ID_DUIN",logicalLinkInstance.getLinkName2()) } - else if(domainType.equalsIgnoreCase("TN-MH")) + else if(domainType.equalsIgnoreCase("TN_MH")) { execution.setVariable("tranportEp_ID_DUEG",logicalLinkInstance.getLinkName()) execution.setVariable("tranportEp_ID_CUIN",logicalLinkInstance.getLinkName2()) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ModifySliceSubnet.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ModifySliceSubnet.groovy index 7e505d1912..146ceddab4 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ModifySliceSubnet.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ModifySliceSubnet.groovy @@ -142,7 +142,8 @@ class ModifySliceSubnet extends AbstractServiceTaskProcessor { ResourceOperationStatus initStatus = new ResourceOperationStatus() initStatus.setServiceId(nsiId) initStatus.setOperationId(jobId) - initStatus.setResourceTemplateUUID(modelUuid) + //initStatus.setResourceTemplateUUID(modelUuid) + initStatus.setResourceInstanceID(nssiId) initStatus.setOperType("Modify") requestDBUtil.prepareInitResourceOperationStatus(execution, initStatus) diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/AllocateSliceSubnet.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/AllocateSliceSubnet.bpmn index 4012467df9..bfc8ccacb2 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/AllocateSliceSubnet.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/AllocateSliceSubnet.bpmn @@ -55,13 +55,13 @@ nss.sendSyncResponse(execution)</bpmn:script> <bpmn:sequenceFlow id="Flow_0ayd6dj" sourceRef="Activity_0qlstj2" targetRef="Activity_1usi32q" /> <bpmn:sequenceFlow id="Flow_0m5n6md" sourceRef="Activity_1usi32q" targetRef="Gateway_15a04ct" /> <bpmn:sequenceFlow id="Flow_1fij4ds" name="Is CN ?" sourceRef="Gateway_15a04ct" targetRef="CallDoAllocateCoreNSSI"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("networkType") == "CN"}</bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("networkType") == "cn"}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:sequenceFlow id="Flow_0g7721r" name="Is TN ?" sourceRef="Gateway_15a04ct" targetRef="CallDoAllocateTransportNSSI"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("networkType") == "TN"}</bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("networkType") == "tn"}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:sequenceFlow id="Flow_1kk0exp" name="Is AN ?" sourceRef="Gateway_15a04ct" targetRef="CallDoAllocateAccessNSSI"> - <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("networkType") == "AN"}</bpmn:conditionExpression> + <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">#{execution.getVariable("networkType") == "an"}</bpmn:conditionExpression> </bpmn:sequenceFlow> <bpmn:sequenceFlow id="Flow_09b50tn" sourceRef="CallDoAllocateAccessNSSI" targetRef="Event_18u424w" /> <bpmn:callActivity id="CallDoAllocateAccessNSSI" name="Call ANAllocateNSSI" calledElement="DoAllocateAccessNSSI"> diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java index 35c5fe1c14..7aaf558901 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java +++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/GrpcNettyServer.java @@ -26,7 +26,7 @@ import javax.annotation.PostConstruct; import org.junit.Rule; import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType; import org.onap.ccsdk.cds.controllerblueprints.common.api.Status; -import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase; +import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput; import org.slf4j.Logger; @@ -35,7 +35,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component -public class GrpcNettyServer extends BlueprintProcessingServiceImplBase { +public class GrpcNettyServer extends BluePrintProcessingServiceImplBase { private static final Logger logger = LoggerFactory.getLogger(GrpcNettyServer.class); @@ -55,7 +55,7 @@ public class GrpcNettyServer extends BlueprintProcessingServiceImplBase { @PostConstruct public void start() throws IOException { - final BlueprintProcessingServiceImplBase blueprintPrcessorImpl = new BlueprintProcessingServiceImplBase() { + final BluePrintProcessingServiceImplBase blueprintPrcessorImpl = new BluePrintProcessingServiceImplBase() { @Override public StreamObserver<ExecutionServiceInput> process( StreamObserver<ExecutionServiceOutput> responseObserver) { diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index cd151bafea..b76cf1eb5f 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -111,13 +111,15 @@ public class WorkflowActionBBTasks { } int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE); - ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence); - - execution.setVariable("buildingBlock", ebb); - currentSequence++; - execution.setVariable(COMPLETED, currentSequence >= flowsToExecute.size()); - execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, currentSequence); - + boolean completed = false; + if (currentSequence < flowsToExecute.size()) { + ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence); + execution.setVariable("buildingBlock", ebb); + execution.setVariable(BBConstants.G_CURRENT_SEQUENCE, currentSequence + 1); + } else { + completed = true; + } + execution.setVariable(COMPLETED, completed); } catch (Exception e) { workflowAction.buildAndThrowException(execution, "Internal Error occured during selectBB", e); } @@ -425,6 +427,9 @@ public class WorkflowActionBBTasks { final boolean aLaCarte = (boolean) execution.getVariable(BBConstants.G_ALACARTE); int currentSequence = (int) execution.getVariable(BBConstants.G_CURRENT_SEQUENCE); logger.debug("Current Sequence: {}", currentSequence); + if (currentSequence >= flowsToExecute.size()) { + execution.setVariable(COMPLETED, true); + } ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence - 1); String bbFlowName = ebb.getBuildingBlock().getBpmnFlowName(); if ("ActivateVfModuleBB".equalsIgnoreCase(bbFlowName) && aLaCarte diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java index a6e29227a0..a0a47a1d16 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/GrpcNettyServer.java @@ -31,7 +31,7 @@ import javax.annotation.PostConstruct; import org.junit.Rule; import org.onap.ccsdk.cds.controllerblueprints.common.api.EventType; import org.onap.ccsdk.cds.controllerblueprints.common.api.Status; -import org.onap.ccsdk.cds.controllerblueprints.processing.api.BlueprintProcessingServiceGrpc.BlueprintProcessingServiceImplBase; +import org.onap.ccsdk.cds.controllerblueprints.processing.api.BluePrintProcessingServiceGrpc.BluePrintProcessingServiceImplBase; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceInput; import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOutput; import org.slf4j.Logger; @@ -40,7 +40,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; @Component -public class GrpcNettyServer extends BlueprintProcessingServiceImplBase { +public class GrpcNettyServer extends BluePrintProcessingServiceImplBase { private static final Logger logger = LoggerFactory.getLogger(GrpcNettyServer.class); @@ -60,7 +60,7 @@ public class GrpcNettyServer extends BlueprintProcessingServiceImplBase { @PostConstruct public void start() throws IOException { - final BlueprintProcessingServiceImplBase blueprintPrcessorImpl = new BlueprintProcessingServiceImplBase() { + final BluePrintProcessingServiceImplBase blueprintPrcessorImpl = new BluePrintProcessingServiceImplBase() { @Override public StreamObserver<ExecutionServiceInput> process( StreamObserver<ExecutionServiceOutput> responseObserver) { diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java index 5cd3055b5f..cbb746d514 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java @@ -149,7 +149,7 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest { workflowActionBBTasks.selectBB(execution); boolean success = (boolean) execution.getVariable("completed"); int currentSequence = (int) execution.getVariable("gCurrentSequence"); - assertTrue(success); + assertFalse(success); assertEquals(1, currentSequence); } |