[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Problems with the Mapping model


I can suggest you to modify meta-model to make it similar to the .ecore
diagram attached. In this case you can create LinkMapping associated with Transition domain model element always having one source/target element tepresented by source/target meta-features in link mapping. In addition you can create LinkConstraints below this LinkMapping containing following source/target end constraints:

Source: not self.oclIsKindOf(FinalState)
Target: not self.oclIsKinfOf(InitialState)

If you want to disable direct transitions from IitialState to Final one then:

Target: if self.oclIsKindOf(FinalState) then not
oppositeEnd.oclIsKindOf(InitialState) else not self.oclIsKinfOf(InitialState) endif

Thank you, this worked wonders! We changed to your model and it got much better. However, we still have some things that we would like to fix...for example that we only want one outgoing link from our InitialState. In an earlier post, you suggested that we should use a constraint like:

if self.oclIsKindOf(A) then self.outgoingTransition->size() = 0 else not self.oclIsKindOf(C) endif

However, when we try to do this (but adding our Final and Initial States instead of A and C), we can't draw any transitions at all...

Also, we would like to set a constraint that says that we can only draw one InitialState-node. We thought this would be solved automatically since the ecore-diagram states that the Statechart hasInitial 0..1, but apparently not...any ideas?

/Linda & Anna