|OCL closure() ends in OclInvalid [message #1429790]
||Tue, 23 September 2014 19:15
| Corinna K
Registered: September 2014
I have an abstract class A and two subclasses B and C inherit from A. The class C has also a composite relation to A, so in the tree-based editor C is like a parent class and can have some children (B & C), C can have further children and so on. In this case a recursion is necessary.|
By using OCL closure() I'm trying to get all my childclasses B. Classes who are only childs and no parents. So I tried to collect all parents of C and wanted to get its children of class B.
I used this constraint:
C -> closure(v:C | v.compositeRelation.oclAsType(C)) //for collecting the parents
If I have only Cs and no Bs in my tree, the constraint works fine, but when there are also Bs I'm getting OclInvalid back.
I think a part in my constraint is missing for filter that the closure method should ignore Bs. All of my attempts are unsuccesful.
Thank you very much for your help!
[Updated on: Wed, 24 September 2014 08:10]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.02242 seconds