- // get instance's names
- final List<String> componentInstancesNames = componentInstances.stream().map(ComponentInstanceDataDefinition::getNormalizedName)
- .collect(toList());
- final Optional<String> componentInstancesNameOptional = componentInstancesNames.stream()
- .filter(cin -> inputName.startsWith(cin + "_")).findFirst();
- if (componentInstancesNameOptional.isPresent() && MapUtils.isNotEmpty(componentInstancesProperties)) {
- final Optional<String> componentInstanceIdOptional = componentInstancesProperties.keySet().stream()
- .filter(key -> key.endsWith("." + componentInstancesNameOptional.get())).findFirst();
- if (componentInstanceIdOptional.isPresent()) {
- // get property's name
- final String propertyNameFromInput = extractPropertyNameFromInputName(inputName, componentInstancesNames);
- return componentInstancesProperties.get(componentInstanceIdOptional.get()).stream()
- .anyMatch(prop -> prop.getName().equals(propertyNameFromInput) && prop.getValue() != null
- && prop.getValue().contains(ToscaGetFunctionType.GET_INPUT.getFunctionName()));
+ outer: for (ComponentInstance instance : componentInstances) {
+ for (PropertyDefinition instanceProperty : instance.getProperties()) {
+ if (CollectionUtils.isNotEmpty(instanceProperty.getGetInputValues())) {
+ for (GetInputValueDataDefinition getInputValueDataDefinition : instanceProperty.getGetInputValues()) {
+ if (inputName.equals(getInputValueDataDefinition.getInputName())) {
+ isInputFromCIProp.set(true);
+ break outer;
+ }
+ }
+ }