From e987cf53cb03f19cb77a23b805dda270efe62385 Mon Sep 17 00:00:00 2001 From: sarada prasad sahoo Date: Thu, 16 May 2019 15:07:16 +0530 Subject: Fix DeleteE2EServiceInstance flow Fixed the issue when subprocess 'DoDeleteE2EServiceInstance' calls 'AAI GenericGetService' sub-process which is deleted from SO common-bpmn Change-Id: Ie170b430a21df6dc8e7ff95a9d7f2091c11a600b Issue-ID: SO-1809 Signed-off-by: sarada prasad sahoo --- .../subprocess/DoDeleteE2EServiceInstance.bpmn | 232 +++++++++------------ 1 file changed, 101 insertions(+), 131 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-flows/src/main/resources') diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn index 9f9d58fa19..4d0324e478 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoDeleteE2EServiceInstance.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_0vz7cd9 @@ -7,28 +7,28 @@ SequenceFlow_0vz7cd9 SequenceFlow_11e6bfy - import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoDeleteE2EServiceInstance() ddsi.preProcessRequest(execution) -]]> + SequenceFlow_0e7inkl - SequenceFlow_188ejvu + SequenceFlow_11e6bfy SequenceFlow_0vi0sv6 - import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoDeleteE2EServiceInstance() -ddsi.postProcessAAIGET(execution)]]> +ddsi.postProcessAAIGET(execution) SequenceFlow_1cevtpy SequenceFlow_12rr1yy SequenceFlow_0e7inkl - import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoCustomDeleteE2EServiceInstance() -ddsi.deleteServiceInstance(execution)]]> +ddsi.deleteServiceInstance(execution) @@ -41,22 +41,22 @@ ddsi.deleteServiceInstance(execution)]]> SequenceFlow_1921mo3 SequenceFlow_18vlzfo - import org.onap.so.bpmn.common.scripts.* ExceptionUtil ex = new ExceptionUtil() -ex.processJavaException(execution)]]> +ex.processJavaException(execution) - + SequenceFlow_1961633 SequenceFlow_1ym9otf - import org.onap.so.bpmn.infrastructure.scripts.* def ddsi = new DoDeleteE2EServiceInstance() -ddsi.preInitResourcesOperStatus(execution)]]> +ddsi.preInitResourcesOperStatus(execution) @@ -81,22 +81,6 @@ ddsi.preInitResourcesOperStatus(execution)]]> SequenceFlow_1j08ko3 - - - - - - - - - - - - - SequenceFlow_11e6bfy - SequenceFlow_188ejvu - - @@ -108,9 +92,9 @@ ddsi.preInitResourcesOperStatus(execution)]]> SequenceFlow_1q2mqnm SequenceFlow_0fo5vw5 - import org.onap.so.bpmn.infrastructure.scripts.* def dcsi= new DoDeleteE2EServiceInstance() -dcsi.prepareDecomposeService(execution)]]> +dcsi.prepareDecomposeService(execution) @@ -130,9 +114,9 @@ dcsi.prepareDecomposeService(execution)]]> SequenceFlow_0orw2f8 SequenceFlow_013rime - import org.onap.so.bpmn.infrastructure.scripts.* def dcsi= new DoDeleteE2EServiceInstance() -dcsi.postDecomposeService(execution)]]> +dcsi.postDecomposeService(execution) @@ -177,7 +161,7 @@ dcsi.postDecomposeService(execution)]]> - + #{(execution.getVariable("isDeleteResourceListValid" ) == true)} @@ -206,12 +190,12 @@ dcsi.postDecomposeService(execution)]]> SequenceFlow_0h5c1bd SequenceFlow_1ab3vex - import org.onap.so.bpmn.infrastructure.scripts.* execution.setVariable("progress", "100") execution.setVariable("result", "finished") execution.setVariable("operationContent", "No actual resoure in service instance") def csi= new DoDeleteE2EServiceInstance() -csi.prepareUpdateServiceOperationStatus(execution)]]> +csi.prepareUpdateServiceOperationStatus(execution) SequenceFlow_0h5c1bd @@ -224,263 +208,249 @@ csi.prepareUpdateServiceOperationStatus(execution)]]> - + - + - + - + - + - + - + - - - - + + + + - - - - + + - - + + - + - + - + - - + + - - + + - + - + - - + + - - - - - - - - - - - - - - + + - - - - + + + + - - - - + + + + - + - + - - + + - + - + - + - + - - + + - + - + - - + + - + - + - - - - + + + + - + - + - + - + - + - + - - + + - + - - + + - - + + - + - + - + - + - - + + - - + + - - - - + + + + -- cgit 1.2.3-korg 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 --- bpmn/MSOCommonBPMN/pom.xml | 4 +- .../client/cds/AbstractCDSProcessingBBUtils.java | 18 +++++- bpmn/pom.xml | 1 + .../resources/process/ConfigurePnfResource.bpmn | 4 +- .../CreateVcpeResCustServiceSimplifiedTest.java | 70 ++++++++++------------ 5 files changed, 55 insertions(+), 42 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-flows/src/main/resources') diff --git a/bpmn/MSOCommonBPMN/pom.xml b/bpmn/MSOCommonBPMN/pom.xml index 20be69c006..e233e6a7c6 100644 --- a/bpmn/MSOCommonBPMN/pom.xml +++ b/bpmn/MSOCommonBPMN/pom.xml @@ -311,7 +311,7 @@ org.onap.appc.client client-lib - 1.5.0-SNAPSHOT + ${appc.client.version} org.mockito @@ -330,7 +330,7 @@ org.onap.appc.client client-kit - 1.5.0-SNAPSHOT + ${appc.client.version} org.mockito diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java index 6bfa67502d..5498b5be31 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/cds/AbstractCDSProcessingBBUtils.java @@ -34,6 +34,7 @@ import org.onap.ccsdk.cds.controllerblueprints.processing.api.ExecutionServiceOu import org.onap.so.client.PreconditionFailedException; import org.onap.so.client.RestPropertiesLoader; import org.onap.so.client.cds.beans.AbstractCDSPropertiesBean; +import org.onap.so.client.exception.BadResponseException; import org.onap.so.client.exception.ExceptionBuilder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -58,6 +59,12 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener { private static final String FAILED = "Failed"; private static final String PROCESSING = "Processing"; + /** + * indicate exception thrown. + */ + private static final String EXCEPTION = "Exception"; + + private final AtomicReference cdsResponse = new AtomicReference<>(); @Autowired @@ -132,7 +139,15 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener { } if (cdsResponse != null) { - execution.setVariable("CDSStatus", cdsResponse.get()); + String cdsResponseStatus = cdsResponse.get(); + execution.setVariable("CDSStatus", cdsResponseStatus); + + /** + * throw CDS failed exception. + */ + if (cdsResponseStatus != SUCCESS) { + throw new BadResponseException("CDS call failed with status: " + cdsResponseStatus); + } } } catch (Exception ex) { @@ -177,6 +192,7 @@ public class AbstractCDSProcessingBBUtils implements CDSProcessingListener { public void onError(Throwable t) { Status status = Status.fromThrowable(t); logger.error("Failed processing blueprint {}", status, t); + cdsResponse.set(EXCEPTION); } } diff --git a/bpmn/pom.xml b/bpmn/pom.xml index c4aad4ba69..fd070bb81b 100644 --- a/bpmn/pom.xml +++ b/bpmn/pom.xml @@ -25,6 +25,7 @@ UTF-8 UTF-8 1.5.1 + 1.6.0-SNAPSHOT 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 diff --git a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java index f51ea006d2..35f8f45999 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java +++ b/bpmn/so-bpmn-infrastructure-flows/src/test/java/org/onap/so/bpmn/infrastructure/process/CreateVcpeResCustServiceSimplifiedTest.java @@ -33,10 +33,8 @@ import com.google.protobuf.Struct; import java.io.IOException; import java.util.List; import java.util.UUID; -import org.camunda.bpm.engine.runtime.Execution; import org.camunda.bpm.engine.runtime.ProcessInstance; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.onap.ccsdk.cds.controllerblueprints.common.api.ActionIdentifiers; import org.onap.ccsdk.cds.controllerblueprints.common.api.CommonHeader; @@ -52,12 +50,13 @@ import org.springframework.beans.factory.annotation.Autowired; /** * Basic Integration test for createVcpeResCustService_Simplified.bpmn workflow. */ -@Ignore public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { - private static final long WORKFLOW_WAIT_TIME = 1000L; private Logger logger = LoggerFactory.getLogger(getClass()); + private static final long WORKFLOW_WAIT_TIME = 1000L; + private static final int DMAAP_DELAY_TIME_MS = 2000; + private static final String TEST_PROCESSINSTANCE_KEY = "CreateVcpeResCustService_simplified"; private String testBusinessKey; @@ -113,17 +112,9 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { ProcessInstance pi = runtimeService.startProcessInstanceByKey(TEST_PROCESSINSTANCE_KEY, testBusinessKey, variables); - assertThat(pi).isNotNull(); - - Thread.sleep(WORKFLOW_WAIT_TIME); - - Execution execution = runtimeService.createExecutionQuery().processInstanceBusinessKey(testBusinessKey) - .messageEventSubscriptionName("WorkflowMessage").singleResult(); - - assertThat(execution).isNotNull(); int waitCount = 10; - while (!pi.isEnded() && waitCount >= 0) { + while (!isProcessInstanceEnded() && waitCount >= 0) { Thread.sleep(WORKFLOW_WAIT_TIME); waitCount--; } @@ -145,6 +136,11 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { } } + private boolean isProcessInstanceEnded() { + return runtimeService.createProcessInstanceQuery().processDefinitionKey(TEST_PROCESSINSTANCE_KEY) + .singleResult() == null; + } + private void checkConfigAssign(ExecutionServiceInput executionServiceInput) { logger.info("Checking the configAssign request"); @@ -154,26 +150,26 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { * the fields of actionIdentifiers should match the one in the * response/createVcpeResCustServiceSimplifiedTest_catalogdb.json. */ - assertThat(actionIdentifiers.getBlueprintName()).matches("test_configuration_restconf"); - assertThat(actionIdentifiers.getBlueprintVersion()).matches("1.0.0"); - assertThat(actionIdentifiers.getActionName()).matches("config-assign"); - assertThat(actionIdentifiers.getMode()).matches("sync"); + assertThat(actionIdentifiers.getBlueprintName()).isEqualTo("test_configuration_restconf"); + assertThat(actionIdentifiers.getBlueprintVersion()).isEqualTo("1.0.0"); + assertThat(actionIdentifiers.getActionName()).isEqualTo("config-assign"); + assertThat(actionIdentifiers.getMode()).isEqualTo("sync"); CommonHeader commonHeader = executionServiceInput.getCommonHeader(); - assertThat(commonHeader.getOriginatorId()).matches("SO"); - assertThat(commonHeader.getRequestId()).matches(msoRequestId); + assertThat(commonHeader.getOriginatorId()).isEqualTo("SO"); + assertThat(commonHeader.getRequestId()).isEqualTo(msoRequestId); Struct payload = executionServiceInput.getPayload(); Struct requeststruct = payload.getFieldsOrThrow("config-assign-request").getStructValue(); - assertThat(requeststruct.getFieldsOrThrow("resolution-key").getStringValue()).matches("PNFDemo"); + assertThat(requeststruct.getFieldsOrThrow("resolution-key").getStringValue()).isEqualTo("PNFDemo"); Struct propertiesStruct = requeststruct.getFieldsOrThrow("config-assign-properties").getStructValue(); - assertThat(propertiesStruct.getFieldsOrThrow("pnf-name").getStringValue()).matches("PNFDemo"); + assertThat(propertiesStruct.getFieldsOrThrow("pnf-name").getStringValue()).isEqualTo("PNFDemo"); assertThat(propertiesStruct.getFieldsOrThrow("service-model-uuid").getStringValue()) - .matches("f2daaac6-5017-4e1e-96c8-6a27dfbe1421"); + .isEqualTo("f2daaac6-5017-4e1e-96c8-6a27dfbe1421"); assertThat(propertiesStruct.getFieldsOrThrow("pnf-customization-uuid").getStringValue()) - .matches("68dc9a92-214c-11e7-93ae-92361f002680"); + .isEqualTo("68dc9a92-214c-11e7-93ae-92361f002680"); } private void checkConfigDeploy(ExecutionServiceInput executionServiceInput) { @@ -185,32 +181,32 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { * the fields of actionIdentifiers should match the one in the * response/createVcpeResCustServiceSimplifiedTest_catalogdb.json. */ - assertThat(actionIdentifiers.getBlueprintName()).matches("test_configuration_restconf"); - assertThat(actionIdentifiers.getBlueprintVersion()).matches("1.0.0"); - assertThat(actionIdentifiers.getActionName()).matches("config-deploy"); - assertThat(actionIdentifiers.getMode()).matches("async"); + assertThat(actionIdentifiers.getBlueprintName()).isEqualTo("test_configuration_restconf"); + assertThat(actionIdentifiers.getBlueprintVersion()).isEqualTo("1.0.0"); + assertThat(actionIdentifiers.getActionName()).isEqualTo("config-deploy"); + assertThat(actionIdentifiers.getMode()).isEqualTo("async"); CommonHeader commonHeader = executionServiceInput.getCommonHeader(); - assertThat(commonHeader.getOriginatorId()).matches("SO"); - assertThat(commonHeader.getRequestId()).matches(msoRequestId); + assertThat(commonHeader.getOriginatorId()).isEqualTo("SO"); + assertThat(commonHeader.getRequestId()).isEqualTo(msoRequestId); Struct payload = executionServiceInput.getPayload(); Struct requeststruct = payload.getFieldsOrThrow("config-deploy-request").getStructValue(); - assertThat(requeststruct.getFieldsOrThrow("resolution-key").getStringValue()).matches("PNFDemo"); + assertThat(requeststruct.getFieldsOrThrow("resolution-key").getStringValue()).isEqualTo("PNFDemo"); Struct propertiesStruct = requeststruct.getFieldsOrThrow("config-deploy-properties").getStructValue(); - assertThat(propertiesStruct.getFieldsOrThrow("pnf-name").getStringValue()).matches("PNFDemo"); + assertThat(propertiesStruct.getFieldsOrThrow("pnf-name").getStringValue()).isEqualTo("PNFDemo"); assertThat(propertiesStruct.getFieldsOrThrow("service-model-uuid").getStringValue()) - .matches("f2daaac6-5017-4e1e-96c8-6a27dfbe1421"); + .isEqualTo("f2daaac6-5017-4e1e-96c8-6a27dfbe1421"); assertThat(propertiesStruct.getFieldsOrThrow("pnf-customization-uuid").getStringValue()) - .matches("68dc9a92-214c-11e7-93ae-92361f002680"); + .isEqualTo("68dc9a92-214c-11e7-93ae-92361f002680"); /** * IP addresses match the OAM ip addresses from AAI. */ - assertThat(propertiesStruct.getFieldsOrThrow("pnf-ipv4-address").getStringValue()).matches("1.1.1.1"); - assertThat(propertiesStruct.getFieldsOrThrow("pnf-ipv6-address").getStringValue()).matches("::/128"); + assertThat(propertiesStruct.getFieldsOrThrow("pnf-ipv4-address").getStringValue()).isEqualTo("1.1.1.1"); + assertThat(propertiesStruct.getFieldsOrThrow("pnf-ipv6-address").getStringValue()).isEqualTo("::/128"); } /** @@ -223,8 +219,8 @@ public class CreateVcpeResCustServiceSimplifiedTest extends BaseBPMNTest { /** * Get the events from PNF topic */ - wireMockServer - .stubFor(get(urlPathMatching("/events/pnfReady/consumerGroup.*")).willReturn(okJson(pnfResponse))); + wireMockServer.stubFor(get(urlPathMatching("/events/pnfReady/consumerGroup.*")) + .willReturn(okJson(pnfResponse).withFixedDelay(DMAAP_DELAY_TIME_MS))); } private void mockAai() { -- cgit 1.2.3-korg From 253a7e17c7b89acfc3cb8748239a544bade75437 Mon Sep 17 00:00:00 2001 From: Yang Xu Date: Fri, 24 May 2019 16:17:50 -0400 Subject: Typo in bpmn mso-request-id variable name Change-Id: I50e7f33a3a38e77c84874d75ab33c5f9bb693f8b Issue-ID: SO-1922 Signed-off-by: Yang Xu --- .../src/main/resources/subprocess/DoCreateVnf.bpmn | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-flows/src/main/resources') diff --git a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnf.bpmn b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnf.bpmn index 50436352ea..df95cf0210 100644 --- a/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnf.bpmn +++ b/bpmn/so-bpmn-infrastructure-flows/src/main/resources/subprocess/DoCreateVnf.bpmn @@ -1,5 +1,5 @@ - + SequenceFlow_1 @@ -90,7 +90,7 @@ createVnf.preProcessSDNCActivateRequest(execution)]]> - + -- 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') 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') 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') 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