From c45553d2e9bd80b842b46656fff86e357f959bf1 Mon Sep 17 00:00:00 2001 From: "Kalkere Ramesh, Sharan (sk720x)" Date: Fri, 7 Dec 2018 14:11:47 -0500 Subject: fixed headers for traceability Changed if condition and updated to get last element/instance in the list. Add block to handle when there is more than 1 process instance returned. Update headers for traceability in logging Change-Id: Ibb2cd0bf5ba7cd733371a204c0b61e418564df97 Issue-ID: SO-1301 Signed-off-by: Kalkere Ramesh, Sharan (sk720x) --- .../bpmn/common/scripts/SDNCAdapterRestV1.groovy | 5 +- .../so/bpmn/common/scripts/VnfAdapterRestV1.groovy | 7 +- .../main/resources/subprocess/FalloutHandler.bpmn | 1 + .../main/resources/subprocess/SDNCAdapterV1.bpmn | 175 ++++++++++----------- 4 files changed, 98 insertions(+), 90 deletions(-) (limited to 'bpmn/MSOCommonBPMN/src/main') diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy index d7fc6ac995..0cefae526e 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/SDNCAdapterRestV1.groovy @@ -207,7 +207,10 @@ class SDNCAdapterRestV1 extends AbstractServiceTaskProcessor { URL url = new URL(sdncAdapterUrl); - HttpClient httpClient = new HttpClient(url, "application/json", TargetEntity.SDNC_ADAPTER) + HttpClient httpClient = new HttpClient(url, "application/json", TargetEntity.SDNC_ADAPTER) + httpClient.addAdditionalHeader("X-ONAP-RequestID", execution.getVariable("mso-request-id")) + httpClient.addAdditionalHeader("X-ONAP-InvocationID", UUID.randomUUID().toString()) + httpClient.addAdditionalHeader("X-ONAP-PartnerName", "SO-SDNCAdapter") httpClient.addAdditionalHeader("mso-request-id", execution.getVariable("mso-request-id")) httpClient.addAdditionalHeader("mso-service-instance-id", execution.getVariable("mso-service-instance-id")) httpClient.addAdditionalHeader("Authorization", execution.getVariable(prefix + "basicAuthHeaderValue")) diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy index 13cc7f8d11..1452a9ad8d 100644 --- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy +++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/VnfAdapterRestV1.groovy @@ -29,6 +29,8 @@ import org.onap.so.client.HttpClient import org.onap.so.logger.MessageEnum import org.onap.so.logger.MsoLogger import org.onap.so.utils.TargetEntity +import java.util.UUID + @@ -311,7 +313,10 @@ class VnfAdapterRestV1 extends AbstractServiceTaskProcessor { HttpClient httpClient = new HttpClient(url, "application/xml", TargetEntity.VNF_ADAPTER) httpClient.addAdditionalHeader("Authorization", execution.getVariable(prefix + "basicAuthHeaderValue")) - + + httpClient.addAdditionalHeader("X-ONAP-RequestID", execution.getVariable("mso-request-id")) + httpClient.addAdditionalHeader("X-ONAP-InvocationID", UUID.randomUUID().toString()) + httpClient.addAdditionalHeader("X-ONAP-PartnerName", "SO-VNFAdapter") Response response; if ("GET".equals(vnfAdapterMethod)) { diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn index 990863ec93..6914e7575f 100644 --- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/FalloutHandler.bpmn @@ -70,6 +70,7 @@ falloutHandler.postProcessResponse(execution)]]> application/soap+xml #{BasicAuthHeaderValueDB} + #{FH_request_id} diff --git a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn index 2ae2ff7f8b..91c38241a2 100644 --- a/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn +++ b/bpmn/MSOCommonBPMN/src/main/resources/subprocess/SDNCAdapterV1.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_15 @@ -8,28 +8,29 @@ - #{execution.getVariable("SDNCA_ResponseCode")=='200'} + badSynchronousResponse Exception - import org.onap.so.bpmn.common.scripts.* + +exceptionUtil.buildWorkflowException(execution, 7000, "Could not communicate with the SDNC Adapter" )]]> - ${execution.getVariable("mso.adapters.sdnc.endpoint")} + POST application/soap+xml #{BasicAuthHeaderValue} + #{mso-request-id} ${sdncAdapterRequest} @@ -65,20 +66,18 @@ exceptionUtil.buildWorkflowException(execution, 7000, "Could not communicate wit SequenceFlow_1 SequenceFlow_8 - import org.onap.so.bpmn.common.scripts.* + +sdnc.preProcessRequest(execution)]]> SequenceFlow_9 SequenceFlow_11ah5pw SequenceFlow_14 - import org.onap.so.bpmn.common.scripts.* + +sdnc.postProcessResponse(execution)]]> @@ -88,7 +87,7 @@ sdnc.postProcessResponse(execution) - #{execution.getVariable("asynchronousResponseTimeout")==true} + SequenceFlow_2 @@ -111,17 +110,17 @@ sdnc.postProcessResponse(execution) SequenceFlow_0mzs1ze SequenceFlow_11ah5pw - import org.onap.so.bpmn.common.scripts.* + +sdnc.setTimeout(execution)]]> goodSynchronousResponse SequenceFlow_26 SequenceFlow_2 - import org.onap.so.bpmn.common.scripts.* + +sdnc.resetCallbackRequest(execution)]]> @@ -131,14 +130,14 @@ sdnc.resetCallbackRequest(execution) - #{execution.getVariable("continueListening")==true} + SequenceFlow_1w1za5m SequenceFlow_17 - import org.onap.so.bpmn.common.scripts.* + +sdnc.toggleSuccessIndicator(execution)]]> @@ -168,9 +167,9 @@ sdnc.toggleSuccessIndicator(execution) SequenceFlow_22 SequenceFlow_27 - import org.onap.so.bpmn.common.scripts.* + +sdnc.assignError(execution)]]> @@ -183,7 +182,7 @@ sdnc.assignError(execution) SequenceFlow_23 - #{execution.getVariable("serviceConfigActivate")==true} + @@ -215,7 +214,7 @@ sdnc.assignError(execution) SequenceFlow_4 SequenceFlow_193cb6p - execution.setVariable("SDNCA_InterimNotify", true) + @@ -225,7 +224,7 @@ sdnc.assignError(execution) Done SequenceFlow_1w1za5m - execution.setVariable("SDNCA_InterimNotify", false) + @@ -264,23 +263,23 @@ sdnc.assignError(execution) - - - + + + - - + + - - + + @@ -292,24 +291,24 @@ sdnc.assignError(execution) - - + + - - + + - - - - + + + + @@ -330,8 +329,8 @@ sdnc.assignError(execution) - - + + @@ -340,8 +339,8 @@ sdnc.assignError(execution) - - + + @@ -350,8 +349,8 @@ sdnc.assignError(execution) - - + + @@ -363,16 +362,16 @@ sdnc.assignError(execution) - - + + - - - + + + @@ -384,8 +383,8 @@ sdnc.assignError(execution) - - + + @@ -394,17 +393,17 @@ sdnc.assignError(execution) - - - - + + + + - - + + @@ -416,8 +415,8 @@ sdnc.assignError(execution) - - + + @@ -429,8 +428,8 @@ sdnc.assignError(execution) - - + + @@ -442,17 +441,17 @@ sdnc.assignError(execution) - - - + + + - - - + + + @@ -461,8 +460,8 @@ sdnc.assignError(execution) - - + + @@ -486,22 +485,22 @@ sdnc.assignError(execution) - - + + - - + + - - + + @@ -519,17 +518,17 @@ sdnc.assignError(execution) - - - + + + - - - + + + @@ -547,8 +546,8 @@ sdnc.assignError(execution) - - + + @@ -560,8 +559,8 @@ sdnc.assignError(execution) - - + + @@ -570,8 +569,8 @@ sdnc.assignError(execution) - - + + -- cgit 1.2.3-korg