diff options
author | Arthur Martella <amartell@research.att.com> | 2017-10-18 15:22:26 -0400 |
---|---|---|
committer | Arthur Martella <amartell@research.att.com> | 2017-10-18 15:24:25 -0400 |
commit | 955a4a0d2c1a1740fac46d6946e700442e6079c6 (patch) | |
tree | 8ddf391646d491501a3890a5badf35c9b718a93a | |
parent | d55ca28ac5ccbc3644318449291df1725bf0b047 (diff) |
productFamilyId not found error catching
Properly catch JsonException in case when productFamilyId is not present to let if block handle case where it's missing.
Change-Id: Id6eb2aaf10bc8636470ced3fe96c1149bb7e905e
Issue-id: SO-236
Signed-off-by: Arthur Martella <amartell@research.att.com>
-rw-r--r-- | bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy index 9416e6851a..80d714893d 100644 --- a/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy +++ b/bpmn/MSOInfrastructureBPMN/src/main/groovy/org/openecomp/mso/bpmn/infrastructure/scripts/CreateGenericALaCarteServiceInstance.groovy @@ -37,6 +37,7 @@ import org.camunda.bpm.engine.runtime.Execution import org.apache.commons.lang3.* import org.apache.commons.codec.binary.Base64; import org.springframework.web.util.UriUtils +import org.json.JSONException; /** * This groovy class supports the <class>CreateGenericALaCarteServiceInstance.bpmn</class> process. @@ -85,7 +86,12 @@ public class CreateGenericALaCarteServiceInstance extends AbstractServiceTaskPro execution.setVariable("source", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.source")) execution.setVariable("serviceInstanceName", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.instanceName")) execution.setVariable("disableRollback", jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.suppressRollback")) - String productFamilyId = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.productFamilyId") + String productFamilyId = null; + try { + productFamilyId = jsonUtil.getJsonValue(siRequest, "requestDetails.requestInfo.productFamilyId") + } catch (JSONException e) { + productFamilyId = null; + } if (isBlank(productFamilyId)) { msg = "Input productFamilyId is null" |