| Listing 2. Share: feature OCL rules. |
|
context Feature::call(t:Tuple):Boolean, Tuple
def: found : Sequence(Service) = select(s : Share.discovery(id) | let s.pre(k:Tuple):Boolean, self.post(v,q):Boolean, s. function(w):r in t.isOclType() = k.isOclType() and t.isOclType() = v.isOclType() and r.isOclType() = q.isOclType() and s.pre(t) and self.post(t,s.function(t))) post: if found->notEmpty() then result = {true, found->first().function(t)} else result = {false, Sequence{}} endif |