in

The ORM Foundation

Get the facts!

Invalid Constraint

Last post Fri, Aug 1 2008 16:37 by Matthew Curland. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • Fri, Aug 1 2008 13:23

    • JimLudden
    • Top 10 Contributor
      Male
    • Joined on Wed, Jul 16 2008
    • Taos, New Mexico, USA
    • Posts 75

    Invalid Constraint

    I get the message "Error 1 Model 'IT Management' contains multiple constraints named 'ValueTypeValueConstraint5'. Constraint names must be unique in the model. \\Tkzaw-pro-14\Mydocs6\JimLud\My Documents\Visual Studio 2008\Projects\IT_Management.orm 0 0 "

     However I cannot find this constraint to delete it. "ValueType" does not appear in the ORM Model Browser either as a Fact or an Object. (It was deleted earlier.)

    How do I remove the error?

  • Fri, Aug 1 2008 16:37 In reply to

    Re: Invalid Constraint

    I can't see the file, and this isn't an issue I've seen before. Generally, the only way to get duplicate names is to merge model files (such as with a source code control system) or hand-edit the xml. In any case, to clean up the .orm file:

     Generally, if the error is not associated with a displayed element, then double-clicking the error in the error list should automatically select it in the model browser. However, in this case, the value constraint are displayed indirectly through the corresponding ValueTypes, so there is no way to get to the names in the model browser.

    To fix manually:

    1. Open the .orm file in the xml editor. To do this, use the drop down button to the right of the 'Open' button on the VS file open dialog and choose 'Open With...'. Select the XML editor from the list.
    2. Search for Name="ValueTypeValueConstraint5" (you might want to note which value type it is associated with).
    3. Change the attribute to Name=""
    4. Save the xml file and reopen the .orm file in the NORMA editor. A new name will be regenerated on reload.

    If you only find the ValueTypeValueConstraint5 name in the orm:ModelErrors section (it will be in an orm:ConstraintDuplicateNameError element), then just delete the element. I'd be surprised if you found this case.

    Do you think it is worth letting the model browser display additional elements beneath ValueTypes and Roles to explicitly show the ValueConstraint object? The other options are to auto-fix this error on a double-click in the error list, or to show a 'ValueConstraintName' property on the ValueType.

    We've also planned on regenerating any name that matches one of our auto-generated patterns and has a duplicate name error on load. This is a common problem with merged XML files, and is a hassle to clean up.

    Please let me know what you find.

    Thanks for the report Jim, it's good to hear from you.

    -Matt

Page 1 of 1 (2 items)
© 2008-2020 The ORM Foundation: A UK not-for-profit organisation -------------- Terms of Service