Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » Problems with a loop
Problems with a loop [message #1817472] Fri, 22 November 2019 20:57 Go to next message
da ru is currently offline da ruFriend
Messages: 6
Registered: February 2019
Junior Member
Hi folks , i,m trying to do a loop that collect me objects that meet a property , this looks me several days , and i can,t to find the mistake , maybe somebody can to help me , thanks , this is the code :


tick()
begin
for p in (self.paquetes -> collect( p | p.tiempoRestante = 0)) do
declare ns : Servidor , nt : Transmisor ;
if (self.servidor -> notEmpty()) then
ns := self.servidor -> sortedBy(n | n.paquetes -> size()) -> any(true) ;
self.transmitirS(p , ns) ;
else
nt := self.nodo2 -> sortedBy(n | n.paquetes -> size()) -> any(true) ;
delete (self,p) from Procesando ;
insert (nt,p) into Procesando ;
nt.recibirT(p,self);
end
end
end


At compile time it says to me that p , in self.transmitirS(p,ns) , is a boolean and not an object , it have to be an object of self.paquetes , why is a boolean ??? . thanks
Re: Problems with a loop [message #1817479 is a reply to message #1817472] Sat, 23 November 2019 08:09 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 6614
Registered: July 2009
Senior Member
Hi

While there are some sub-expressions in your example that are probably OCL, the example as whole is clearly not OCL. OCL has no begin/for/do/end/insert/delete/:=/boolean/declare/into/from.

Regards

Ed Willink
Previous Topic:OCL XText Console not available in Eclipse 2019-09
Next Topic:OCLinEcore: Custom validation messages not working
Goto Forum:
  


Current Time: Mon Mar 30 14:52:25 GMT 2020

Powered by FUDForum. Page generated in 0.01887 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top