Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » ATL » Please help me to check the helper context in ATL(just a helper)
icon5.gif  Please help me to check the helper context in ATL [message #1219188] Mon, 02 December 2013 09:32 Go to next message
hu xiang is currently offline hu xiang
Messages: 2
Registered: December 2013
Junior Member
helper context UML!Action def:valueOfActionFiringRate:Real=
	let node:UML!Node=UML!Node.allInstances->select(e|e.name=(self.getValue(self.getAppliedStereotypes().first(),'host'))) in
		let r1:String=node.getValue(node.getAppliedStereotypes().first(),'thoughput') in 
			let r2:String=self.getValue(self.getAppliedStereotypes().first(),'hostDemand') in
				let i:Integer=s.indexOf('exp(') in
					let j:Integer=r1.indexOf('),')  in
						let r11:String=r1.substring((i+5),j) in
							let r22:String=r1.substring((i+5),j) in
								let number:Real=r1.toReal()*r2.toReal in
									number;



ATL can not easily debug. Maybe my code has systax error. Please some people may easily find out the error and let me know.

UML!Action --paStep --host='Resource' hostDemand=(exp(2),s)
UML!node --name=Resource
--GaExeHost --thoughtput=(exp(2),s)
I want to find the respongding resource in the context of UML!Action.

Tks
Re: Please help me to check the helper context in ATL [message #1219272 is a reply to message #1219188] Tue, 03 December 2013 00:33 Go to previous messageGo to next message
hu xiang is currently offline hu xiang
Messages: 2
Registered: December 2013
Junior Member
Is there anyone who can offer some help?
Maybe some suggestions, such as how to debug atl code or print the object.
Tks
Re: Please help me to check the helper context in ATL [message #1219313 is a reply to message #1219188] Tue, 03 December 2013 04:41 Go to previous message
Ed Willink is currently offline Ed Willink
Messages: 3844
Registered: July 2009
Senior Member
Hi

I am sure the ATL editor gives you useful syntax errors. Use it.

If you have too many errors, start with a smaller example so that you
and ATL do not get confused by an excess of problems.

Regards

Ed Willink


On 02/12/2013 16:08, hu xiang wrote:
>
> helper context UML!Action def:valueOfActionFiringRate:Real=
> let
> node:UML!Node=UML!Node.allInstances->select(e|e.name=(self.getValue(self.getAppliedStereotypes().first(),'host')))
> in
> let
> r1:String=node.getValue(node.getAppliedStereotypes().first(),'thoughput')
> in let
> r2:String=self.getValue(self.getAppliedStereotypes().first(),'hostDemand')
> in
> let i:Integer=s.indexOf('exp(') in
> let j:Integer=r1.indexOf('),') in
> let r11:String=r1.substring((i+5),j) in
> let r22:String=r1.substring((i+5),j) in
> let number:Real=r1.toReal()*r2.toReal in
> number;
>
>
>
> ATL can not easily debug. Maybe my code has systax error. Please some
> people may easily find out the error and let me know.
>
> UML!Action --paStep --host='Resource' hostDemand=(exp(2),s)
> UML!node --name=Resource
> --GaExeHost --thoughtput=(exp(2),s)
> I want to find the respongding resource in the context of UML!Action.
>
> Tks
>
Previous Topic:Problem when using GetValue
Next Topic:Generated model with wrong xmi tags
Goto Forum:
  


Current Time: Fri Apr 18 14:11:20 EDT 2014

Powered by FUDForum. Page generated in 0.01967 seconds