From 8ef2ec86175055aba4158f7ae571e259c7ddeddf Mon Sep 17 00:00:00 2001 From: eeginux Date: Thu, 23 May 2019 10:51:36 +0100 Subject: exception handling Update the appc client jar version Throw exception for non success cds call Fix CreateVcpeResCustServiceSimplifiedTest IT Issue-ID: SO-1857 SO-1779 Change-Id: Ifee080600051c92fd964a92d16efb67e4ab05d5d Signed-off-by: eeginux --- .../src/main/resources/process/ConfigurePnfResource.bpmn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-flows/src/main/resources/process') diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ConfigurePnfResource.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ConfigurePnfResource.bpmn index f489a27052..9a1a7ed628 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ConfigurePnfResource.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/ConfigurePnfResource.bpmn @@ -30,7 +30,7 @@ SequenceFlow_17llfxw SequenceFlow_0p0aqtx - + SequenceFlow_0p0aqtx SequenceFlow_1owbpsy SequenceFlow_1w4p9f7 @@ -49,7 +49,7 @@ SequenceFlow_0jfgn7n SequenceFlow_08voj55 - + SequenceFlow_08voj55 SequenceFlow_1n080up SequenceFlow_0d24h26 -- cgit 1.2.3-korg From 0d9e1e9383e17e715fdabac7744c6b930eca1b20 Mon Sep 17 00:00:00 2001 From: "marios.iakovidis" Date: Thu, 23 May 2019 18:29:10 +0300 Subject: fixed typos and added SERVICE_INSTANCE_ID Change-Id: I68174bf2e67280a4bf65d8f26b04793b76896f04 Issue-ID: SO-1913 Signed-off-by: MariosIakovidis --- .../org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy | 12 ++++++++++-- .../src/main/resources/process/HandlePNF.bpmn | 5 +++-- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-flows/src/main/resources/process') diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy index 261f107140..f06d71cec4 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/HandlePNF.groovy @@ -38,18 +38,26 @@ public class HandlePNF extends AbstractServiceTaskProcessor{ @Override void preProcessRequest(DelegateExecution execution) { logger.debug("Start preProcess for HandlePNF") - // set correlation ID def resourceInput = execution.getVariable("resourceInput") String serInput = jsonUtil.getJsonValue(resourceInput, "requestsInputs") String correlationId = jsonUtil.getJsonValue(serInput, "service.parameters.requestInputs.ont_ont_pnf_name") if (!StringUtils.isEmpty(correlationId)) { - execution.setVariable(ExecutionVariableNames.CORRELATION_ID, correlationId) + execution.setVariable(ExecutionVariableNames.PNF_CORRELATION_ID, correlationId) logger.debug("Found correlation id : " + correlationId) } else { logger.error("== correlation id is empty ==") exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "correlation id is not provided") } + + String serviceInstanceID = jsonUtil.getJsonValue(resourceInput, ExecutionVariableNames.SERVICE_INSTANCE_ID) + if (!StringUtils.isEmpty(serviceInstanceID)) { + execution.setVariable(ExecutionVariableNames.SERVICE_INSTANCE_ID, serviceInstanceID) + logger.debug("found serviceInstanceID: "+serviceInstanceID) + } else { + logger.error("== serviceInstance ID is empty ==") + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, "serviceInstance ID is not provided") + } // next task will set the uuid logger.debug("exit preProcess for HandlePNF") diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn index c81b289737..01ca152e61 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1c92ks3_activate @@ -21,8 +21,9 @@ handlePNF.preProcessRequest(execution) - + + SequenceFlow_1apj1fn SequenceFlow_0pujwl4 -- cgit 1.2.3-korg From f3655618ffadc982bd8b45488e3b3bc2bc01ec02 Mon Sep 17 00:00:00 2001 From: "marios.iakovidis" Date: Mon, 27 May 2019 22:54:42 +0300 Subject: Fixed errors in HandlePnf flow Change-Id: I1cf49f98f26e322b4785cc14f96ee63a5830117e Issue-ID: SO-1930 Signed-off-by: MariosIakovidis --- .../src/main/resources/process/HandlePNF.bpmn | 21 ++++----------------- 1 file changed, 4 insertions(+), 17 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-flows/src/main/resources/process') diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn index 01ca152e61..257a0dee64 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/HandlePNF.bpmn @@ -6,14 +6,12 @@ SequenceFlow_1c92ks3_activate - SequenceFlow_17xr584 SequenceFlow_12q67gd import org.onap.so.bpmn.infrastructure.scripts.* def handlePNF = new HandlePNF() handlePNF.preProcessRequest(execution) - SequenceFlow_02fi1yn @@ -24,6 +22,7 @@ handlePNF.preProcessRequest(execution) + SequenceFlow_1apj1fn SequenceFlow_0pujwl4 @@ -31,7 +30,6 @@ handlePNF.preProcessRequest(execution) SequenceFlow_0pujwl4 SequenceFlow_1la8oih - SequenceFlow_1ezf4gu import org.onap.so.bpmn.infrastructure.scripts.* def handlePNF = new HandlePNF() handlePNF.postProcessRequest(execution) @@ -40,13 +38,10 @@ handlePNF.postProcessRequest(execution) SequenceFlow_12q67gd - SequenceFlow_17xr584 SequenceFlow_1apj1fn - - SequenceFlow_1ezf4gu SequenceFlow_1la8oih SequenceFlow_02fi1yn import org.onap.so.bpmn.infrastructure.scripts.* @@ -69,10 +64,6 @@ handlePNF.sendSyncResponse(execution) - - - - @@ -95,19 +86,15 @@ handlePNF.sendSyncResponse(execution) - + - + - + - - - - -- cgit 1.2.3-korg From 6f0f3ab69de1013f6d3e5951223e014f2b3daa48 Mon Sep 17 00:00:00 2001 From: "marios.iakovidis" Date: Mon, 3 Jun 2019 00:31:21 +0300 Subject: Added orchestration status to service Issue-ID: SO-1938 Signed-off-by: MariosIakovidis Change-Id: I78cc401a746ef4dbca41a869729b9791210038f4 --- .../scripts/CreateCustomE2EServiceInstance.groovy | 43 +++++++ .../scripts/CreateSDNCNetworkResource.groovy | 5 +- .../scripts/DoCreateResources.groovy | 5 + .../process/CreateCustomE2EServiceInstance.bpmn | 35 +++-- .../subprocess/DoCreateE2EServiceInstance.bpmn | 141 +++++++++++---------- 5 files changed, 147 insertions(+), 82 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-flows/src/main/resources/process') diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy index bd465eb9a8..a771741e18 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateCustomE2EServiceInstance.groovy @@ -23,6 +23,13 @@ package org.onap.so.bpmn.infrastructure.scripts +import org.onap.aai.domain.yang.ServiceInstance +import org.onap.so.bpmn.core.domain.ServiceDecomposition +import org.onap.so.bpmn.core.domain.VnfResource +import org.onap.so.client.aai.AAIObjectType +import org.onap.so.client.aai.AAIResourcesClient +import org.onap.so.client.aai.entities.uri.AAIResourceUri +import org.onap.so.client.aai.entities.uri.AAIUriFactory import org.onap.so.logger.ErrorCode; import static org.apache.commons.lang3.StringUtils.* @@ -332,5 +339,41 @@ public class CreateCustomE2EServiceInstance extends AbstractServiceTaskProcessor } logger.trace("finished prepareInitServiceOperationStatus") } + + public void updateAAIOrchStatus (DelegateExecution execution){ + logger.debug(" ***** start updateAAIOrchStatus ***** ") + String msg = "" + String serviceInstanceId = execution.getVariable("serviceInstanceId") + logger.debug("serviceInstanceId: "+serviceInstanceId) + ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition") + + try { + ServiceInstance si = execution.getVariable("serviceInstanceData") + boolean allActive = true + for (VnfResource resource : serviceDecomposition.vnfResources) { + logger.debug("resource.modelInfo.getModelName: " + resource.modelInfo.getModelName() +" | resource.getOrchestrationStatus: "+resource.getOrchestrationStatus()) + if (resource.getOrchestrationStatus() != "Active") { + allActive = false + } + } + + if (allActive){ + si.setOrchestrationStatus("Active") + }else { + si.setOrchestrationStatus("Pending") + } + AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, serviceInstanceId) + client.update(uri, si) + } catch (BpmnError e) { + throw e + } catch (Exception ex) { + msg = "Exception in org.onap.so.bpmn.common.scripts.CompleteMsoProcess.updateAAIOrchStatus " + ex.getMessage() + logger.info( msg) + exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg) + } + + logger.debug(" ***** end updateAAIOrchStatus ***** ") + } } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy index b0749ded86..b70797c63b 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSDNCNetworkResource.groovy @@ -243,12 +243,11 @@ public class CreateSDNCNetworkResource extends AbstractServiceTaskProcessor { String ontsn = jsonUtil.getJsonValue(serInput, "service.parameters.requestInputs.ont_ont_serial_num") - String uResourceInput = jsonUtil.addJsonValue(resourceInput, "requestInputs.c_vlan", cvlan) - uResourceInput = jsonUtil.addJsonValue(uResourceInput, "requestInputs.s_vlan", svlan) + String uResourceInput = jsonUtil.addJsonValue(resourceInput, "requestInputs.CVLAN", cvlan) + uResourceInput = jsonUtil.addJsonValue(uResourceInput, "requestInputs.SVLAN", svlan) uResourceInput = jsonUtil.addJsonValue(uResourceInput, "requestInputs.remote_id", remoteId) uResourceInput = jsonUtil.addJsonValue(uResourceInput, "requestInputs.manufacturer", manufacturer) uResourceInput = jsonUtil.addJsonValue(uResourceInput, "requestInputs.ONTSN", ontsn) - logger.debug("old resource input:" + resourceInputObj.toString()) resourceInputObj.setResourceParameters(uResourceInput) execution.setVariable(Prefix + "resourceInput", resourceInputObj.toString()) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy index 98def612de..b49f00a247 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateResources.groovy @@ -280,5 +280,10 @@ public class DoCreateResources extends AbstractServiceTaskProcessor{ public void postConfigRequest(DelegateExecution execution){ //now do noting + ServiceDecomposition serviceDecomposition = execution.getVariable("serviceDecomposition") + for (VnfResource resource : serviceDecomposition.vnfResources) { + resource.setOrchestrationStatus("Active") + } + execution.setVariable("serviceDecomposition", serviceDecomposition) } } diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn index 04ff48d4ed..c1b5ef82de 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/process/CreateCustomE2EServiceInstance.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_0s2spoq @@ -44,6 +44,8 @@ ex.processJavaException(execution) + + SequenceFlow_19eilro SequenceFlow_0klbpxx @@ -74,7 +76,7 @@ csi.prepareCompletionRequest(execution) - SequenceFlow_0je30si + SequenceFlow_0kaz8ac SequenceFlow_0yayvrf @@ -140,7 +142,7 @@ csi.sendSyncResponse(execution) #{execution.getVariable("WorkflowException") == null} - + #{execution.getVariable("WorkflowException") != null} @@ -175,6 +177,14 @@ csi.prepareInitServiceOperationStatus(execution) SequenceFlow_081z8l2 + + + SequenceFlow_0je30si + SequenceFlow_0kaz8ac + import org.onap.so.bpmn.infrastructure.scripts.* +def csi = new CreateCustomE2EServiceInstance() +csi.updateAAIOrchStatus(execution) + @@ -192,9 +202,9 @@ csi.prepareInitServiceOperationStatus(execution) - + - + @@ -204,7 +214,7 @@ csi.prepareInitServiceOperationStatus(execution) - + @@ -246,8 +256,8 @@ csi.prepareInitServiceOperationStatus(execution) - - + + @@ -270,7 +280,7 @@ csi.prepareInitServiceOperationStatus(execution) - + @@ -386,6 +396,13 @@ csi.prepareInitServiceOperationStatus(execution) + + + + + + + diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn index eccb9486dd..76dd6facd6 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateE2EServiceInstance.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1qiiycn @@ -7,10 +7,10 @@ SequenceFlow_1qiiycn SequenceFlow_0w9t6tc - import org.onap.so.bpmn.infrastructure.scripts.* def dcsi = new DoCreateE2EServiceInstance() dcsi.preProcessRequest(execution) -]]> + @@ -36,28 +36,28 @@ dcsi.preProcessRequest(execution) SequenceFlow_0tgrn11 SequenceFlow_1lqktwf - import org.onap.so.bpmn.infrastructure.scripts.* def dcsi = new DoCreateE2EServiceInstance() dcsi.preProcessRollback(execution) -]]> + SequenceFlow_0eumzpf SequenceFlow_1xzgv5k - import org.onap.so.bpmn.infrastructure.scripts.* def dcsi = new DoCreateE2EServiceInstance() dcsi.postProcessRollback(execution) -]]> + SequenceFlow_012h7yx SequenceFlow_1tkgqu3 - import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoCreateE2EServiceInstance() -ddsi.createServiceInstance(execution)]]> +ddsi.createServiceInstance(execution) SequenceFlow_0w9t6tc @@ -66,9 +66,9 @@ ddsi.createServiceInstance(execution)]]> SequenceFlow_0xjwb45 SequenceFlow_012h7yx - import org.onap.so.bpmn.infrastructure.scripts.* def dcsi= new DoCreateE2EServiceInstance() -dcsi.processDecomposition(execution)]]> +dcsi.processDecomposition(execution) @@ -85,9 +85,9 @@ dcsi.processDecomposition(execution)]]> SequenceFlow_166w91p SequenceFlow_0qxzgvq - import org.onap.so.bpmn.infrastructure.scripts.* def dcsi= new DoCreateE2EServiceInstance() -dcsi.prepareDecomposeService(execution)]]> +dcsi.prepareDecomposeService(execution) SequenceFlow_166w91p @@ -111,9 +111,9 @@ dcsi.prepareDecomposeService(execution)]]> SequenceFlow_1y9rkfr SequenceFlow_0n7nbx3 - import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoCreateE2EServiceInstance() -ddsi.preInitResourcesOperStatus(execution)]]> +ddsi.preInitResourcesOperStatus(execution) @@ -154,6 +154,7 @@ ddsi.preInitResourcesOperStatus(execution)]]> + SequenceFlow_0b1dsaj SequenceFlow_0sphcy5 @@ -161,16 +162,16 @@ ddsi.preInitResourcesOperStatus(execution)]]> SequenceFlow_022onug SequenceFlow_0b1dsaj - import org.onap.so.bpmn.infrastructure.scripts.* def csi = new DoCreateE2EServiceInstance() -csi.preProcessForAddResource(execution)]]> +csi.preProcessForAddResource(execution) SequenceFlow_0sphcy5 SequenceFlow_18gnns6 - import org.onap.so.bpmn.infrastructure.scripts.* def csi = new DoCreateE2EServiceInstance() -csi.postProcessForAddResource(execution)]]> +csi.postProcessForAddResource(execution) SequenceFlow_18gnns6 @@ -178,16 +179,16 @@ csi.postProcessForAddResource(execution)]]> SequenceFlow_0yuzaen SequenceFlow_1y9rkfr - import org.onap.so.bpmn.infrastructure.scripts.* def dcsi= new DoCreateE2EServiceInstance() -dcsi.doProcessSiteLocation(execution)]]> +dcsi.doProcessSiteLocation(execution) SequenceFlow_0ckto7v SequenceFlow_022onug - import org.onap.so.bpmn.infrastructure.scripts.* def dcsi= new DoCreateE2EServiceInstance() -dcsi.doTPResourcesAllocation(execution)]]> +dcsi.doTPResourcesAllocation(execution) @@ -230,15 +231,15 @@ dcsi.doTPResourcesAllocation(execution)]]> - - + + - - + + @@ -250,8 +251,8 @@ dcsi.doTPResourcesAllocation(execution)]]> - - + + @@ -260,10 +261,10 @@ dcsi.doTPResourcesAllocation(execution)]]> - - - - + + + + @@ -290,29 +291,29 @@ dcsi.doTPResourcesAllocation(execution)]]> - - + + - - + + - - + + - - + + @@ -324,19 +325,19 @@ dcsi.doTPResourcesAllocation(execution)]]> - - - - + + + + - - - - + + + + @@ -348,10 +349,10 @@ dcsi.doTPResourcesAllocation(execution)]]> - - - - + + + + @@ -384,61 +385,61 @@ dcsi.doTPResourcesAllocation(execution)]]> - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - \ No newline at end of file + -- cgit 1.2.3-korg