diff options
author | hetengjiao <hetengjiao@chinamobile.com> | 2020-09-28 17:55:32 +0800 |
---|---|---|
committer | hetengjiao <hetengjiao@chinamobile.com> | 2020-09-28 17:55:40 +0800 |
commit | 5bed5a76aac23bbabd34312dd2f5b7623c24c586 (patch) | |
tree | 30e82636367a8fa32ea388657380032058cfdad4 /bpmn | |
parent | af1efe8d52d325929e4e9231576a9a5f97e143ae (diff) |
add method adapt SliceTaskParamsAdapter to SliceTaskParams
Issue-ID: SO-2963
Signed-off-by: hetengjiao <hetengjiao@chinamobile.com>
Change-Id: Ie8038437ccaa54ee7477d09fd09f2818db2a65a0
Diffstat (limited to 'bpmn')
-rw-r--r-- | bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy index 65398eb658..72fd052f31 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy @@ -20,6 +20,8 @@ package org.onap.so.bpmn.infrastructure.scripts +import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder + import static org.apache.commons.lang3.StringUtils.* import org.camunda.bpm.engine.delegate.BpmnError import org.camunda.bpm.engine.delegate.DelegateExecution @@ -52,11 +54,15 @@ public class CreateSliceService extends AbstractServiceTaskProcessor { String Prefix = "CRESS_" ExceptionUtil exceptionUtil = new ExceptionUtil() + JsonUtils jsonUtil = new JsonUtils() + JsonSlurper jsonSlurper = new JsonSlurper() + ObjectMapper objectMapper = new ObjectMapper() + OofUtils oofUtils = new OofUtils() - NssmfAdapterUtils nssmfAdapterUtils = new NssmfAdapterUtils(httpClientFactory, jsonUtil) + AAIResourcesClient client = getAAIClient() private static final Logger logger = LoggerFactory.getLogger(CreateSliceService.class) @@ -161,8 +167,7 @@ public class CreateSliceService extends AbstractServiceTaskProcessor { execution.setVariable("serviceInputParams", inputMap) execution.setVariable("uuiRequest", uuiRequest) - execution.setVariable("se" + - "rviceProfile", serviceProfile) + execution.setVariable("serviceProfile", serviceProfile) //TODO //execution.setVariable("serviceInputParams", jsonUtil.getJsonValue(siRequest, "requestDetails.requestParameters.userParams")) @@ -267,10 +272,8 @@ public class CreateSliceService extends AbstractServiceTaskProcessor { execution.setVariable("sliceTaskParams", sliceTaskParams) - //todo:---------------------------------------- -// String paramJson = sliceTaskParams.convertToJson() -// execution.setVariable("CSSOT_paramJson", paramJson) - /*-------------------------------------------*/ + String paramJson = sliceTaskParams.convertToJson() + execution.setVariable("CSSOT_paramJson", paramJson) logger.debug("Finish createOrchestrationTask") } @@ -360,7 +363,8 @@ public class CreateSliceService extends AbstractServiceTaskProcessor { logger.debug("Start prepareUpdateOrchestrationTask") String requestMethod = "PUT" String taskStatus = execution.getVariable("taskStatus") - SliceTaskParams sliceTaskParams = execution.getVariable("sliceTaskParams") + SliceTaskParamsAdapter sliceTaskParams = + execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter String paramJson = sliceTaskParams.convertToJson() execution.setVariable("CSSOT_status", taskStatus) execution.setVariable("CSSOT_paramJson", paramJson) @@ -390,7 +394,7 @@ public class CreateSliceService extends AbstractServiceTaskProcessor { OrchestrationTask orchestrationTask = objectMapper.readValue(response, OrchestrationTask.class) String paramJson = orchestrationTask.getParams() logger.debug("paramJson: " + paramJson) - SliceTaskParams sliceTaskParams = new SliceTaskParams() + SliceTaskParamsAdapter sliceTaskParams = new SliceTaskParamsAdapter() sliceTaskParams.convertFromJson(paramJson) execution.setVariable("sliceTaskParams", sliceTaskParams) logger.debug("Finish processUserOptions") @@ -404,7 +408,7 @@ public class CreateSliceService extends AbstractServiceTaskProcessor { try { ServiceInstance si = new ServiceInstance() si.setOrchestrationStatus(orchStatus) - AAIResourcesClient client = new AAIResourcesClient() + AAIResourceUri uri = AAIUriFactory.createResourceUri(Types.SERVICE_INSTANCE.getFragment(serviceInstanceId)) client.update(uri, si) } catch (BpmnError e) { |