module In2Out; create OUT : OutModel from IN : InModel; helper def : isFinishStation(station : InModel!Station) : Boolean = if (station = self.finishStation) then true else false endif; rule Level2Level { from s : InModel!Level to t : OutModel!Level ( stations <- s.stations ) } rule Station2Station { from s : InModel!Station to t : OutModel!Station ( name <- s.name, isFinishStation <- thisModule.isFinishStation(s) ) }
self = self.eContainer().finishStation