[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: RE: [tosca] Complex property composition
In interpret things the same way as Tal, and I don’t believe the grammar specification contradicts this. Since a composite property is defined as a collection of (sub) properties (where each of these sub-properties could themselves be composite),
the “property assignment” grammar can be used not only for the top-level property assignment, but for assignment of the sub-property values as well (or for sub-properties of sub-properties and so on). This means that each sub-property could use their own intrinsic
functions if necessary. Each of these sub-properties define their own type, so it is entirely possible to fully validate complex property values. Without support for this type of complex value assignment, TOSCA would lose a lot of its flexibility Thanks, Chris From: tosca@lists.oasis-open.org <tosca@lists.oasis-open.org>
On Behalf Of Nemeth, Denes (Nokia - HU/Budapest) Dear Tal Are you sure about this, because the spec says that :
“3.6.11.2 Grammar
Property assignments have the following grammar:
3.6.11.2.1 Short notation:
The following single-line grammar may be used when a simple value assignment is needed:
In the above grammars, the pseudo values that appear in angle brackets have the following meaning: · property_name: represents
the name of a property that would be used to select a property definition with the same name within on a TOSCA entity (e.g., Node Template, Relationship Template, etc.,) which is declared in its declared type (e.g., a Node Type, Node Template, Capability Type,
etc.). · property_value, property_value_expression: represent
the type-compatible value to assign to the named property. Property values may be provided as the result from the evaluation of an _expression_ or a function. “ For me this definition would mean that the property can either have a fixed value assignment or can be specified via a Tosca function. It does not say anywhere that a property may be constructed from multiple functions. Would not the possibility of constructing a complex property look like this? <propertyName>: <property_value> |
{ <property_value_expression> } | <composite> <composite>: <key>: <property_value> | <composite> , where <key> is a fixed value or
{ <property_value_expression> } Maybe Puccini has more advanced capabilities that is described in the specs. My second problem with this approach is that the parser can not the value of the property p1:
child1:
get_input: simple_input_child1 value of the child1 is
xor
In this case the parser is lucky because it can deduct that it is the 2nd Case (because of the type of child1 is string). However in a generic case when such deduction is not possible and a complex property is constructed from N number of Tosca functions or fixed values. The complex value may have 2^N variants (exponential), how should we choose which is the actual value. Here is an example for the problem. tosca_definitions_version: tosca_simple_yaml_1_2 data_types: data_type_1: derived_from: tosca.datatypes.Root properties: child1: type: map child2: type: map node_types: node_type_1: properties: p1: type: data_type_1 topology_template: inputs: simple_input_child1: type: map default: a: b simple_input_child2: type: map default: c: d node_templates: node_template_2: type: node_type_1 properties: p1: child1: get_input: simple_input_child1 child2: get_input: simple_input_child2 What is the resolved value of p1: child1: a: b child2: c: d or child1: get_input: simple_input_child1 child2: c: d or child1: get_input: simple_input_child2 child2: c: d or child1: get_input: simple_input_child1 child2: get_input: simple_input_child2 I think that at least some kind of precedence would be required between values and function. For example if the value of a property can be evaluated as a Tosca function, than it is considered
to be the value of the tosca function. From:
tosca@lists.oasis-open.org <tosca@lists.oasis-open.org> on behalf of Tal Liron <tliron@redhat.com> Yes, I'm sure it is possible. You can think of it this way: a data type just like a node template also has properties, so these both accept assigned values in the same way. This implies that you can nest values to any depth. The situation is less clear when we are dealing with list and map types. However, I think that it likewise should be possible. And for maps, it should even be possible to use function calls for map keys. (Puccini
supports all these cases.) Example: On Wed, Apr 21, 2021 at 9:50 AM Nemeth, Denes (Nokia - HU/Budapest) <denes.nemeth@nokia.com> wrote:
|
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]