Fix directory + tabs 'running bp processor in IDE'
[ccsdk/cds.git] / docs / modelingconcepts / expression.rst
1 .. This work is a derivative of https://wiki.onap.org/display/DW/Modeling+Concepts#Concepts-198012600
2 .. This work is licensed under a Creative Commons Attribution 4.0
3 .. International License. http://creativecommons.org/licenses/by/4.0
4 .. Copyright (C) 2020 Deutsche Telekom AG.
5
6
7 .. _expression:
8
9 Expression
10 ----------
11
12 TOSCA provides for a set of functions to reference elements within the template or to retrieve runtime values.
13
14 **Below is a list of supported expressions**
15
16 .. tabs::
17
18    .. tab:: get_input
19
20       **get_input**
21
22       The **get_input** function is used to retrieve the values of properties declared
23       within the inputs section of a TOSCA Service Template.
24
25       Within CDS, this is mainly Workflow inputs.
26
27       `TOSCA specification
28       <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454178>`_
29
30       **Example:**
31
32       `<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/golden-blueprint.json#L210>`_
33
34       .. code-block:: json
35
36          "resolution-key": {
37             "get_input": "resolution-key"
38          }
39
40    .. tab:: get_property
41
42       **get_property**
43
44       The **get_property** function is used to retrieve property values between modelable
45       entities defined in the same service template.
46
47       `TOSCA specification
48       <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454178>`_
49
50       **Example:**
51
52       .. code-block:: json
53
54          "get_property": ["SELF", "property-name"]
55
56    .. tab:: get_attribute
57
58       **get_attribute**
59
60       The **get_attribute** function is used to retrieve the values of named attributes declared
61       by the referenced node or relationship template name.
62
63       `TOSCA specification
64       <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454178>`_
65
66       **Example:**
67
68       `<https://github.com/onap/ccsdk-cds/blob/master/components/model-catalog/blueprint-model/test-blueprint/golden/Definitions/golden-blueprint.json#L64-L67>`_
69
70       .. code-block:: json
71
72          "get_attribute": [
73             "resource-assignment",
74             "assignment-params"
75          ]
76
77    .. tab:: get_operation_output
78
79       **get_operation_output**
80
81       The **get_operation_output** function is used to retrieve the values of variables
82       exposed / exported from an interface operation.
83
84       `TOSCA specification
85       <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454180>`_
86
87       **Example:**
88
89       .. code-block:: json
90
91          "get_operation_output": ["SELF", "interface-name", "operation-name", "output-property-name"]
92
93    .. tab:: get_artifact
94
95       **get_artifact**
96
97       The **get_artifact** function is used to retrieve artifact location between modelable
98       entities defined in the same service template.
99
100       `TOSCA specification
101       <http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.2/csd01/TOSCA-Simple-Profile-YAML-v1.2-csd01.html#_Toc494454182>`_
102
103       **Example:**
104
105       .. code-block:: json
106
107          "get_artifact" : ["SELF", "artifact-template", "location", true]