in

The ORM Foundation

Get the facts!

Error when replacing two valuetypes by an objectified fact type

Last post 12-20-2013 20:42 by Matthew Curland. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-20-2013 3:28

    • koneill
    • Top 25 Contributor
      Male
    • Joined on 02-16-2012
    • The Netherlands
    • Posts 25

    Error when replacing two valuetypes by an objectified fact type

     Ran into this while modelling; I made a mistake in my thinking and tried to correct a fact type through the fact type editor.

    - Create a objectified binary fact type and link two value types (value type 1 and value type 2)

    - Create a ternary fact type and give value type 1 and 2 a role in it, give the third role to a third value type (value type 3).

    - Now, select the ternary fact type and open the fact editor, which reads "[Value type 1] did something with [Value type 2] at [Value type 3]"

    - Remove Value type 1 and 2 from the fact editor and replace them with the objectified binary fact type. The fact editor now reads; " [Objectified Fact Type]  at ValueType3()".

    - Press [enter]. Now the fact type reads; "[Objectified Fact Type]  [Objectified Fact Type]  at ValueType3()". This is strange, because I would expect a binary fact type between the objectified fact type and value type 3. But for some reason after pressing [enter] it links the objectified fact type to role 1 and 2 of the ternary fact type

    - Now click on a role in the ternary fact type; you'll get an "assertion failed" error and VS will restart

     

    Now there's an easy workaround of course; model it correctly! :)

    I'm using Visual studio 2012 11.0.61030.00 Update 4 and the latest version of NORMA.

     

     

  • 12-20-2013 8:12 In reply to

    Re: Error when replacing two valuetypes by an objectified fact type

     Very interesting.

    So, for the benefit of other readers would you care to explain what you consider that your "mistake(s)" is/are?

    Thanks

    Ken

  • 12-20-2013 20:11 In reply to

    Re: Error when replacing two valuetypes by an objectified fact type

    Hi Karl,

    Good bug, and good timing because I'm getting a public release ready and will get this fixed.

    The crash is happening in the reading editor because the number of roles in the fact type and the associated readings do not match. If you close the reading editor (fully closed, not just a hidden tab) before committing the fact editor you shouldn't see this crash.

    The real problem is that the fact editor is making a partial edit in this case. It isn't deleting the extra role when you switch from a ternary to a binary with a selected fact type.

    -Matt

  • 12-20-2013 20:42 In reply to

    Re: Error when replacing two valuetypes by an objectified fact type

    Hi Karl,

    The fix is a missing break statement at line 675 in http://sourceforge.net/p/orm/code/HEAD/tree/trunk/ORMModel/Shell/FactEditor/FactEditorSaver.cs.

    In this example, there are two roles from the old fact type in limbo because they don't match the new types. One gets the new type, the other is supposed to be deleted. The missing break causes both available roles to be marked as used (for one new slot) the role deletion never happens because all roles are marked as used.

    Easy fix, I'll slip it in with the next changeset.

    Thanks for the bug.

    -Matt

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