Skip to main content
1-Visitor
November 6, 2015
Question

Enumerated property

  • November 6, 2015
  • 1 reply
  • 1141 views

Hi everybody,

How can I create an enumerated Thing property?

For example I have 3 options for "status" property: Critical, Low, Normal.

How can I define property to allow only one of the enumerated value?

I'm not speaking about any mashups and widgets. I want to provide data integrity on the model level.

Thanks in advance.

Regards,

  Sergey

    1 reply

    1-Visitor
    November 6, 2015

    You can't out of the box. Various things to consider:

    • Not enumerated baseType

    • You can do it through DataTables to enumerate posible values, but there's isn't any kind of Data Integrity between a thing Property and a Data Table column value --> You can implement a data integrity system with events and route all the property update calls to a custom service
    • Also you will find that there isn't any data integrity either between DataTables --> Again you can implement your own Data Integrity system through custom service, it's a I pain yes.

    Best Regards,

    Carles.