+
+ let newProperty;
+ if (this.filterType === FilterType.CAPABILITY) {
+ const currentProperty = this.capabilityNameAndPropertiesMap.get(this.currentRule.capabilityName)
+ .find(property => property.name === this.currentRule.servicePropertyName);
+ newProperty = new PropertyFEModel(currentProperty);
+ } else {
+ newProperty = new PropertyFEModel(this.selectedInstanceProperties.find(property => property.name === this.currentRule.servicePropertyName));
+ }
+ newProperty.value = undefined;
+ newProperty.toscaFunction = undefined;
+
+ this.propertiesUtils.initValueObjectRef(newProperty);
+ this.selectedProperty = newProperty;
+ this.currentRule.originalType = this.selectedProperty.type;
+ }
+
+ isStaticSource(): boolean {
+ return this.selectedSourceType === SourceType.STATIC
+ }
+
+ isToscaFunctionSource(): boolean {
+ return this.selectedSourceType === SourceType.TOSCA_FUNCTION
+ }
+
+ isToscaFunctionListSource(): boolean {
+ return this.selectedSourceType === SourceType.TOSCA_FUNCTION_LIST
+ }
+
+ isComplexListMapType(): boolean {
+ return this.selectedProperty && this.selectedProperty.derivedDataType > 0;
+ }
+
+ isRangeType(): boolean {
+ return this.selectedProperty && this.selectedProperty.derivedDataType == 4;
+ }
+
+ isLengthOperator(): boolean {
+ return this.lengthArray.indexOf(this.currentRule.constraintOperator) > -1;
+ }
+
+ isInRangeOperator(): boolean {
+ return this.currentRule.constraintOperator && this.currentRule.constraintOperator === ConstraintOperatorType.IN_RANGE;
+ }
+
+ isValidValuesOperator(): boolean {
+ return this.currentRule.constraintOperator && this.currentRule.constraintOperator === ConstraintOperatorType.VALID_VALUES;
+ }
+
+ updateComplexListMapTypeRuleValue(): void {
+ this.currentRule.value = PropertyFEModel.cleanValueObj(this.selectedProperty.valueObj);
+ this.onValueChange(this.selectedProperty.valueObjIsValid);
+ }
+
+ onToscaFunctionValidityChange(validationEvent: ToscaFunctionValidationEvent): void {
+ if (validationEvent.isValid && validationEvent.toscaFunction) {
+ if (this.isValidValuesOperator()) {
+ this.currentRule.value = this.validValuesToscaFunctionList;
+ this.currentRule.sourceType = SourceType.TOSCA_FUNCTION_LIST;
+ if (validationEvent.toscaFunction instanceof ToscaGetFunction) {
+ this.currentRule.sourceName = SourceType.TOSCA_FUNCTION_LIST;
+ }
+ else if (validationEvent.toscaFunction instanceof ToscaCustomFunction) {
+ this.currentRule.sourceName = SourceType.TOSCA_FUNCTION_LIST;
+ this.currentRule.sourceType = SourceType.TOSCA_FUNCTION_LIST;
+ }
+ } else {
+ if (this.isLengthOperator()) {
+ this.overridingType = PROPERTY_TYPES.INTEGER;
+ }
+ this.currentRule.value = validationEvent.toscaFunction;
+ this.currentRule.sourceType = validationEvent.toscaFunction.type
+ if (validationEvent.toscaFunction instanceof ToscaGetFunction) {
+ this.currentRule.sourceName = validationEvent.toscaFunction.sourceName;
+ }
+ }
+ } else {
+ this.currentRule.updateValidity(false);
+ this.currentRule.value = undefined;
+ this.currentRule.sourceType = undefined;
+ this.currentRule.sourceName = undefined;
+ }
+ }
+
+ onToscaFunctionListValidityChange(validationEvent: ToscaFunctionValidationEvent, valueIndex: number): void {
+ if (validationEvent.isValid && validationEvent.toscaFunction) {
+ this.validValuesToscaFunctionList.splice(this.validValuesToscaFunctionList.length - 1, 1, validationEvent.toscaFunction);
+ this.currentRule.value = this.validValuesToscaFunctionList;
+ this.currentRule.sourceType = 'SEVERAL';
+ if (validationEvent.toscaFunction instanceof ToscaGetFunction) {
+ this.currentRule.sourceName = validationEvent.toscaFunction.sourceName;