+ private void handleDeprecatedComponentInstancePropertyStructure(final List<ComponentInstanceProperty> propertiesToUpdate,
+ final ComponentTypeEnum componentTypeEnum) {
+ propertiesToUpdate.stream().forEach(property -> {
+ if (property.getGetInputValues() != null) {
+ property.getGetInputValues().stream()
+ .forEach(getInputValue -> property.setToscaFunction(createToscaFunction(getInputValue, componentTypeEnum)));
+ }
+ });
+ }
+
+ private ToscaGetFunctionDataDefinition createToscaFunction(final GetInputValueDataDefinition getInput,
+ final ComponentTypeEnum componentTypeEnum) {
+ final String[] inputIdSplit = getInput.getInputId().split("\\.");
+
+ ToscaGetFunctionDataDefinition toscaFunction = new ToscaGetFunctionDataDefinition();
+ toscaFunction.setFunctionType(ToscaGetFunctionType.GET_INPUT);
+ toscaFunction.setPropertyUniqueId(getInput.getInputId());
+ toscaFunction.setPropertySource(PropertySource.SELF);
+ toscaFunction.setPropertyName(inputIdSplit[1]);
+ toscaFunction.setSourceName(getSourceName(inputIdSplit[0], componentTypeEnum));
+ toscaFunction.setSourceUniqueId(inputIdSplit[0]);
+ toscaFunction.setPropertyPathFromSource(Collections.singletonList(inputIdSplit[1]));
+
+ return toscaFunction;
+ }
+
+ private String getSourceName(final String componentId, final ComponentTypeEnum componentTypeEnum) {
+ ComponentBusinessLogic compBL = componentBusinessLogicProvider.getInstance(componentTypeEnum);
+ final Either<ComponentMetadataData, StorageOperationStatus> componentEither = compBL.getComponentMetadata(componentId);
+ if (componentEither.isLeft()) {
+ return componentEither.left().value().getMetadataDataDefinition().getName();
+ }
+ return "";
+ }
+