diff options
author | Satoshi Fujii <fujii-satoshi@jp.fujitsu.com> | 2020-02-26 15:39:38 +0900 |
---|---|---|
committer | Ofir Sonsino <ofir.sonsino@intl.att.com> | 2020-03-31 05:19:29 +0000 |
commit | 407bbefe5b0b932f6c6bed65193815c78b4d41b5 (patch) | |
tree | 3b6661c29df42df59d72790b91cfaace4a0dd019 /catalog-be/src/main | |
parent | 4f02f33f309c3869d231926582f559aa04816063 (diff) |
Add 'required in runtime' for service inputs
User may want to set required to true for some inputs
so that make sure those input values are given at service
instantiation time.
By this change 'required in runtime' column is introduced into
service inputs table in Properties Assignment screen
and user can select required true/false for each input.
Change-Id: I0d676d2d20e02c975d51c7f4d2bb63c699743d66
Issue-ID: SDC-2659
Signed-off-by: Satoshi Fujii <fujii-satoshi@jp.fujitsu.com>
Diffstat (limited to 'catalog-be/src/main')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java index 02d6e0b565..6b5878ee4b 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/InputsBusinessLogic.java @@ -93,6 +93,8 @@ public class InputsBusinessLogic extends BaseBusinessLogic { private static final String FAILED_TO_FOUND_INPUT_UNDER_COMPONENT_ERROR = "Failed to found input {} under component {}, error: {}"; private static final String GOING_TO_EXECUTE_ROLLBACK_ON_CREATE_GROUP = "Going to execute rollback on create group."; private static final String GOING_TO_EXECUTE_COMMIT_ON_CREATE_GROUP = "Going to execute commit on create group."; + private static final String GOING_TO_EXECUTE_ROLLBACK_ON_UPDATE_INPUT = "Going to execute rollback on update input."; + private static final String GOING_TO_EXECUTE_COMMIT_ON_UPDATE_INPUT = "Going to execute commit on update input."; public LoggerSupportability loggerSupportability=LoggerSupportability.getLogger(InputsBusinessLogic.class.getName()); private final PropertyDeclarationOrchestrator propertyDeclarationOrchestrator; @@ -307,7 +309,8 @@ public class InputsBusinessLogic extends BaseBusinessLogic { if (shouldLockComp) { try { lockComponent(component, UPDATE_INPUT); - }catch (ComponentException e){ + } catch (ComponentException e) { + log.error("Failed to lock component", e); result = Either.right(e.getResponseFormat()); return result; } @@ -337,6 +340,9 @@ public class InputsBusinessLogic extends BaseBusinessLogic { String updateInputObjectValue = updateInputObjectValue(currInput, newInput, dataTypes); currInput.setDefaultValue(updateInputObjectValue); currInput.setOwnerId(userId); + if (newInput.isRequired() != null) { + currInput.setRequired(newInput.isRequired()); + } Either<InputDefinition, StorageOperationStatus> status = toscaOperationFacade.updateInputOfComponent(component, currInput); if(status.isRight()){ ActionStatus actionStatus = componentsUtils.convertFromStorageResponseForResourceInstanceProperty(status.right().value()); @@ -347,13 +353,14 @@ public class InputsBusinessLogic extends BaseBusinessLogic { } } result = Either.left(returnInputs); - }catch (ComponentException e) { - log.debug(GOING_TO_EXECUTE_ROLLBACK_ON_CREATE_GROUP); + } catch (ComponentException e) { + log.debug(GOING_TO_EXECUTE_ROLLBACK_ON_UPDATE_INPUT); unlockRollbackWithException(component, e); } catch (Exception e){ + log.debug(GOING_TO_EXECUTE_ROLLBACK_ON_UPDATE_INPUT); unlockRollbackWithException(component, new ByActionStatusComponentException(ActionStatus.GENERAL_ERROR)); } - log.debug(GOING_TO_EXECUTE_COMMIT_ON_CREATE_GROUP); + log.debug(GOING_TO_EXECUTE_COMMIT_ON_UPDATE_INPUT); unlockWithCommit(component); return result; |