Skip to content

Incorrect handling of enum values in submodel templates #88

@bjoern-otto

Description

@bjoern-otto

In the smt "Digital Nameplate", a field RoleOfContactPerson is defined with values from an enumeration:

class RoleOfContactPerson(Enum):
    Administrative = "0173-1#07-AAS927#001"
    Commercial = "0173-1#07-AAS928#001"
    Other = "0173-1#07-AAS929#001"
    HazardousGoods = "0173-1#07-AAS930#001"
    Technical = "0173-1#07-AAS931#001"

The validation code checks the value attribute for these values, however, it should check the valueId attribute.
E.g. the following snippet is correct:

<property>
    <idShort>RoleOfContactPerson</idShort>
    <valueType>xs:string</valueType>
    <value>Technical Contact</value>  <!--- set in value --->
</property>

And it is equivalent to the following sample, also being correct:

<property>
    <idShort>RoleOfContactPerson</idShort>
    <valueType>xs:string</valueType>
    <valueId>0173-1#07-AAS931#001</value>  <!--- set in valueId --->
</property>

Setting both value and valueId is also allowed as long as these do not conflict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SMTIssues related to SMT validation

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions