[
https://issues.jboss.org/browse/WFCORE-314?page=com.atlassian.jira.plugin...
]
Brian Stansberry commented on WFCORE-314:
-----------------------------------------
You can now easily configure the expected cardinality of a resource type via
SimpleResourceDefinition.Parameters. Default is min 0, max 1 for singleton resource types
(i.e. those with a full specified final PathElement) and min 0 max * for wildcard types.
But at this point the kernel doesn't provide any validation that the model conforms
to these specifications. Since the 'configure' part is now done, I'm going to
change the title of this to be about validation.
Configure child resources as mandatory or its cardinality in
ResourceDefinition
-------------------------------------------------------------------------------
Key: WFCORE-314
URL:
https://issues.jboss.org/browse/WFCORE-314
Project: WildFly Core
Issue Type: Enhancement
Components: Domain Management
Reporter: Pedro Igor
Currently, the ResourceDefinition does not provide a good way to configure a child
resource as mandatory or even its cardinality. Instead of that, manual validations are
required inside handlers.
The idea is remove manual validations and let it be done automatically by the model.
Considering the following example:
{code:xml}
<parent-resource>
<child-resource/>
</parent-resource>
{code}
Would be useful if we could mark the 'child-resource' above as mandatory. Or
even:
{code:xml}
<parent-resource>
<child-resource/>
<child-resource/>
<child-resource/>
<child-resource/> <!-- This is invalid. Only 3 childs are supported. -->
</parent-resource>
{code}
Where we can specify the cardinality for a child-resource so we can configure the min/max
occurrences.
I think the latter approach is more flexible and can be used to get a resource as
mandatory or specify its number of occurrence.
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)