Skip to main content



      Home
Home » Modeling » ATL » extracting a string from a string
extracting a string from a string [message #1763463] Tue, 16 May 2017 08:10 Go to next message
Eclipse UserFriend
Hi everybody,
can anyone help me please how can i verify with ATL that for example a string "'task1_ready" contains a string "_ready".
In fact, i have many strings, for example, task1_ready, task1_working, task1_finish, and i need to get only the strings that contains "_ready".

Thanks in advance.
Regards

Re: extracting a string from a string [message #1763494 is a reply to message #1763463] Tue, 16 May 2017 13:28 Go to previous messageGo to next message
Eclipse UserFriend
Regular ATL only supports the OCL 2.0 string operations (https://wiki.eclipse.org/ATL/User_Guide_-_The_ATL_Language#String_data_type_operations). EMFTVM allows you to use Java String methods on top of that, such as "contains".
Re: extracting a string from a string [message #1763718 is a reply to message #1763494] Thu, 18 May 2017 19:30 Go to previous messageGo to next message
Eclipse UserFriend
Hi Dennis,
Thank you for replying.
i installed EMFTV to try the java String method 'contains', but i don't find the way to use it in the tutorial available on internet. so, as i'm a starter with EMFTV, Can you please give me an idea how to call contains in an ATL code using EMFTV?
Can you please provide me with tutorials to start with EMFTV because i don't manage to find it on internet.
Thank you in advance
Re: extracting a string from a string [message #1763802 is a reply to message #1763718] Fri, 19 May 2017 17:06 Go to previous message
Eclipse UserFriend
There's only the EMFTVM wiki page, which describes what is different from regular ATL. Once you've got your transformation running in EMFTVM, you can use "contains" as follows:
rule Test {
  from s : MM!S (s.taskName.contains('_ready'))
  ...
}
Previous Topic:startsWith(s : String)
Next Topic:error: java.lang.String does not have properties
Goto Forum:
  


Current Time: Fri Nov 07 06:13:27 EST 2025

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

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

Back to the top