Allowed values investigation #656
Replies: 6 comments 6 replies
-
Proposal;:
|
Beta Was this translation helpful? Give feedback.
-
Thank you Octavian for opening this discussion. To highlight the missing part, this is it: The discussion was mainly about inheritance of the type restrictions from typeref. If it is inherited or not. |
Beta Was this translation helpful? Give feedback.
-
Did you check the changebar version of the revision to find the issue that removed it? If there is no issue and it could be an editor mistake. |
Beta Was this translation helpful? Give feedback.
-
@falko I checked the diffs. It was removed in https://issues.omg.org/browse/DMN15-135. Without this paragraph, we have backward compatibility issues - the process of attaching the constraints to types becomes ambiguous. If I remember correctly we did not discuss in the RTF any change in the process of collecting the constraints. I think the removal of the paragraph that explains the process of resolving the constraints for a type is not intentional. @SimonRinguette could you have a look at this, and maybe speak with Dennis as he submitted the proposal? We need to solve this one ASAP, preferably before the release of DMN 1.6. |
Beta Was this translation helpful? Give feedback.
-
Thanks @opatrascoiu to raise the discussion. Reading the motivation for the new
Beside that, the constraint inheritance was already implied also in both the definitions quoted at the begin of this discussion, as @baldimir underlined. Wrapping up, I think that the previous implementation limited a lot the usefullness of the extension mechanism, while the ability to inherit not only fields but also constraint would make the DMN specs much more powerful, allowing use cases that would be currently cumbersome to implement. So, unless there is not a Business requirement to avoid that, I think it would be a good idea to allow the constraint inheritance, that seems to be the most straightful consequence of last modifications. |
Beta Was this translation helpful? Give feedback.
-
Hi, I would like to ask also clarification about this please: |
Beta Was this translation helpful? Give feedback.
-
The DMN 1.4 spec contains the following:
7.3.3 ItemDefinition metamodel
An ItemDefinition element may restrict the values that are allowed from typeRef, using the allowedValues attribute. The allowedValues are an instance of unaryTests that specifies the allowed values or ranges of allowed values within the domain of the typeRef. The type of the allowed values SHALL be consistent with the containing ItemDefinition element. If an ItemDefinition element contains one or more allowedValues, the allowedValues specifies the complete range of values that this ItemDefinition represents. If an ItemDefinition element does not contain allowedValues, its range of allowed values is the full range of the referenced typeRef. In cases where the values that an ItemDefinition element represents are collections of values in the allowed range, the multiplicity can be projected into the attribute isCollection. The default value for this attribute is false.
DMN 1.5 - after the addition of the new constraints
An ItemDefinition element may restrict the values that are allowed from typeRef, using the allowedValues attribute. allowedValues is an instance of UnaryTests that constrains the domain of the typeRef. If an ItemDefinition element does not contain allowedValues, its range of allowed values is the full range of the referenced typeRef. When an ItemDefinition has sibling itemComponents, their values are available in the evaluation context of the UnaryTests of the allowedValues. In cases where the isCollection attribute of an ItemDefinition is true, each element of the collection must satisfy the UnaryTests of the allowedValues, i.e. the allowedValues are projected onto the collection elements. The default value of isCollection is false. The allowedValues attribute has been deprecated as of DMN 1.5 and replaced with the typeConstraint attribute. The typeConstraint attribute differs from allowedValues by not projecting onto collection elements but directly constraining the collection. An alternative way to define an instance of ItemDefinition is as a composition of ItemDefinition elements. An instance of ItemDefinition may contain zero or more itemComponent, which are themselves ItemDefinitions. Each itemComponent in turn may be defined by either a typeRef and allowedValues or a nested itemComponent. In this way, complex types may be defined within DMN. The name of an itemComponent (nested ItemDefinition) must be unique within its containing ItemDefinition or itemComponent.
DRAFT DMN 1.6 - separates the paragraph with no changes
Conclusion:
The change in DMN 1.5 removes by accident a crucial part of the semantics for the allowed values.
Beta Was this translation helpful? Give feedback.
All reactions