From 1916454f803aaa01c33d4d41c28cc6f3b9679c59 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Fri, 24 Aug 2018 09:08:49 -0400 Subject: correct return values of asBean More adds of Optional<> to other ServiceInstance objects. Change to add the Optional<> to the ServiceInstance object. Change-Id: Ie486122412f9ad3d88ba0cf9df41ec226a4b8982 Issue-ID: SO-900 Signed-off-by: Benjamin, Max (mb388a) --- .../scripts/DoCompareModelofE2EServiceInstance.groovy | 6 +++--- .../bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy | 4 ++-- .../so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy | 8 ++++---- .../infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) (limited to 'bpmn/so-bpmn-infrastructure-common/src') diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy index 3702862a04..589bbe9c4f 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCompareModelofE2EServiceInstance.groovy @@ -140,9 +140,9 @@ public class DoCompareModelofE2EServiceInstance extends AbstractServiceTaskProce AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId, serviceType, serviceInstanceId) AAIResultWrapper wrapper = resourceClient.get(serviceInstanceUri, NotFoundException.class) - ServiceInstance si = wrapper.asBean(ServiceInstance.class) - execution.setVariable("model-invariant-id-original", si.getModelInvariantId()) - execution.setVariable("model-version-id-original", si.getModelVersionId()) + Optional si = wrapper.asBean(ServiceInstance.class) + execution.setVariable("model-invariant-id-original", si.get().getModelInvariantId()) + execution.setVariable("model-version-id-original", si.get().getModelVersionId()) }catch(BpmnError e) { throw e; diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy index 4939173d65..913970b051 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateE2EServiceInstance.groovy @@ -319,8 +319,8 @@ public class DoCreateE2EServiceInstance extends AbstractServiceTaskProcessor { AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId, serviceType, serviceInstanceId) AAIResultWrapper wrapper = resourceClient.get(serviceInstanceUri, NotFoundException.class) - ServiceInstance si = wrapper.asBean(ServiceInstance.class) - execution.setVariable("serviceInstanceName", si.getServiceInstanceName()) + Optional si = wrapper.asBean(ServiceInstance.class) + execution.setVariable("serviceInstanceName", si.get().getServiceInstanceName()) }catch(BpmnError e) { throw e; diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy index c7e3eb437c..a79483f6e9 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoDeleteServiceInstance.groovy @@ -310,11 +310,11 @@ public class DoDeleteServiceInstance extends AbstractServiceTaskProcessor { uriList.addAll(wrapper.getRelationships().get().getRelatedAAIUris(AAIObjectType.L3_NETWORK)) if(uriList.isEmpty){ - ServiceInstance si = wrapper.asBean(ServiceInstance.class) - String orchestrationStatus = si.getOrchestrationStatus() - String serviceType = si.getServiceType() + Optional si = wrapper.asBean(ServiceInstance.class) + String orchestrationStatus = si.get().getOrchestrationStatus() + String serviceType = si.get().getServiceType() execution.setVariable("serviceType", serviceType) - execution.setVariable("serviceRole", si.getServiceRole()) + execution.setVariable("serviceRole", si.get().getServiceRole()) if("TRANSPORT".equalsIgnoreCase(serviceType)){ if("PendingDelete".equals(orchestrationStatus)){ diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy index ac8e506e1f..20ced72002 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateCustomE2EServiceInstance.groovy @@ -177,10 +177,10 @@ public class UpdateCustomE2EServiceInstance extends AbstractServiceTaskProcessor AAIResourceUri serviceInstanceUri = AAIUriFactory.createResourceUri(AAIObjectType.SERVICE_INSTANCE, globalSubscriberId, serviceType, serviceInstanceId) AAIResultWrapper wrapper = resourceClient.get(serviceInstanceUri, NotFoundException.class) - ServiceInstance si = wrapper.asBean(ServiceInstance.class) - execution.setVariable("serviceInstanceName", si.getServiceInstanceName()) - execution.setVariable("model-invariant-id-original", si.getModelInvariantId()) - execution.setVariable("model-version-id-original", si.getModelVersionId()) + Optional si = wrapper.asBean(ServiceInstance.class) + execution.setVariable("serviceInstanceName", si.get().getServiceInstanceName()) + execution.setVariable("model-invariant-id-original", si.get().getModelInvariantId()) + execution.setVariable("model-version-id-original", si.get().getModelVersionId()) JSONObject ob = new JSONObject(wrapper.getJson()) JSONArray ar = ob.getJSONObject("relationship-list").getJSONArray("relationship") -- cgit 1.2.3-korg