summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/models/tosca-get-function.ts
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-ui/src/app/models/tosca-get-function.ts')
-rw-r--r--catalog-ui/src/app/models/tosca-get-function.ts12
1 files changed, 7 insertions, 5 deletions
diff --git a/catalog-ui/src/app/models/tosca-get-function.ts b/catalog-ui/src/app/models/tosca-get-function.ts
index 7e6c5ad739..3bb207700b 100644
--- a/catalog-ui/src/app/models/tosca-get-function.ts
+++ b/catalog-ui/src/app/models/tosca-get-function.ts
@@ -34,7 +34,8 @@ export class ToscaGetFunction implements ToscaFunction, ToscaFunctionParameter {
sourceName: string;
functionType: ToscaGetFunctionType;
propertyPathFromSource: Array<string>;
- value: any
+ value: any;
+ toscaIndex: string;
constructor(toscaGetFunction?: ToscaGetFunction) {
if (!toscaGetFunction) {
@@ -48,6 +49,7 @@ export class ToscaGetFunction implements ToscaFunction, ToscaFunctionParameter {
this.sourceUniqueId = toscaGetFunction.sourceUniqueId;
this.sourceName = toscaGetFunction.sourceName;
this.functionType = toscaGetFunction.functionType;
+ this.toscaIndex = toscaGetFunction.toscaIndex;
if (toscaGetFunction.propertyPathFromSource) {
this.propertyPathFromSource = [...toscaGetFunction.propertyPathFromSource];
}
@@ -69,20 +71,20 @@ export class ToscaGetFunction implements ToscaFunction, ToscaFunctionParameter {
private buildGetInputFunctionValue(): Object {
if (this.propertyPathFromSource.length === 1) {
- return {[this.functionType.toLowerCase()]: this.propertyPathFromSource[0]};
+ return {[this.functionType.toLowerCase()]: [this.propertyPathFromSource[0], this.toscaIndex]};
}
- return {[this.functionType.toLowerCase()]: this.propertyPathFromSource};
+ return {[this.functionType.toLowerCase()]: [this.propertyPathFromSource, this.toscaIndex]};
}
private buildFunctionValueWithPropertySource(): Object {
if (this.propertySource == PropertySource.SELF) {
return {
- [this.functionType.toLowerCase()]: [PropertySource.SELF, ...this.propertyPathFromSource]
+ [this.functionType.toLowerCase()]: [PropertySource.SELF, ...this.propertyPathFromSource, this.toscaIndex]
};
}
if (this.propertySource == PropertySource.INSTANCE) {
return {
- [this.functionType.toLowerCase()]: [this.sourceName, ...this.propertyPathFromSource]
+ [this.functionType.toLowerCase()]: [this.sourceName, ...this.propertyPathFromSource,this.toscaIndex]
};
}
}