private static final String UPDATE_INPUT = "UpdateInput";
private static final Logger log = Logger.getLogger(InputsBusinessLogic.class);
private static final String FAILED_TO_FOUND_COMPONENT_ERROR = "Failed to found component {}, error: {}";
- private static final String GET_PROPERTIES_BY_INPUT = "get Properties by input";
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.";
}
public Either<List<InputDefinition>, ResponseFormat> updateInputsValue(ComponentTypeEnum componentType, String componentId,
- List<InputDefinition> inputs, String userId, boolean shouldLockComp,
- boolean inTransaction) {
+ List<InputDefinition> inputs, String userId, boolean shouldLockComp) {
List<InputDefinition> returnInputs = new ArrayList<>();
Either<List<InputDefinition>, ResponseFormat> result = null;
org.openecomp.sdc.be.model.Component component = null;
return createMultipleInputs(userId, componentId, componentTypeEnum, componentInstInputsMap, true, false);
}
- public Either<List<InputDefinition>, ResponseFormat> createMultipleInputs(String userId, String componentId, ComponentTypeEnum componentType,
- ComponentInstInputsMap componentInstInputsMapUi, boolean shouldLockComp,
- boolean inTransaction) {
+ private Either<List<InputDefinition>, ResponseFormat> createMultipleInputs(String userId, String componentId, ComponentTypeEnum componentType,
+ ComponentInstInputsMap componentInstInputsMapUi,
+ boolean shouldLockComp,
+ boolean inTransaction) {
Either<List<InputDefinition>, ResponseFormat> result = null;
org.openecomp.sdc.be.model.Component component = null;
try {
private ComponentsUtils componentsUtils;
private PropertyOperation propertyOperation;
- public DefaultPropertyDeclarator(ComponentsUtils componentsUtils, PropertyOperation propertyOperation) {
+ protected DefaultPropertyDeclarator(ComponentsUtils componentsUtils, PropertyOperation propertyOperation) {
this.componentsUtils = componentsUtils;
this.propertyOperation = propertyOperation;
}
private InputDefinition createInput(Component component, PROPERTYOWNER propertiesOwner, ComponentInstancePropInput propInput,
PropertyDataDefinition prop) {
String generatedInputPrefix = propertiesOwner.getNormalizedName();
- if (propertiesOwner.getUniqueId().equals(propInput.getParentUniqueId())) {
+ if (component.getUniqueId().equals(propInput.getParentUniqueId())) {
//Creating input from property create on self using add property..Do not add the prefix
generatedInputPrefix = null;
}
return buildErrorResponse(getComponentsUtils().getResponseFormat(ActionStatus.UNSUPPORTED_ERROR));
}
Either<List<InputDefinition>, ResponseFormat> actionResponse = inputsBusinessLogic
- .updateInputsValue(componentType, componentId, inputsToUpdate, userId, true, false);
+ .updateInputsValue(componentType, componentId, inputsToUpdate, userId, true);
if (actionResponse.isRight()) {
return buildErrorResponse(actionResponse.right().value());
}
.thenReturn(Either.left(inputDef));
Either<List<InputDefinition>, ResponseFormat> result =
- testInstance.updateInputsValue(service.getComponentType(), COMPONENT_ID, newInputDefs, USER_ID, true, false);
+ testInstance.updateInputsValue(service.getComponentType(), COMPONENT_ID, newInputDefs, USER_ID, true);
assertThat(result.isLeft()).isTrue();
// check if values are updated
assertEquals(NEW_VALUE, service.getInputs().get(0).getDefaultValue());
private String parentPropertyType;
private String subPropertyInputPath;
private List<Annotation> annotations;
- /**
- * The resource id which this property belongs to
- */
- private String parentUniqueId;
private List<GetInputValueDataDefinition> getInputValues;
private Boolean isDeclaredListInput = Boolean.FALSE;
private List<GetPolicyValueDataDefinition> getPolicyValues;
return mappedToComponentProperty;
}
+ /**
+ * The resource id which this property belongs to
+ */
public String getParentUniqueId() {
return getOwnerId();
}