| [ETL] Error "Property 'stereotype' not found in object Class [...]" [message #1125128] |
Fri, 04 October 2013 03:20  |
Alexander Fülleborn Messages: 32 Registered: April 2013 |
Member |
|
|
Hello all,
in my ETL module, I want to restrict transformations to elements with a certain stereotype. Hence, I need to determine the stereotype of the elements. I do this using an own operation called "hasStereotype", see the following code.
operation Source!Class hasStereotype(name:String):Boolean {
return self.stereotype.exists(st:Class!Stereotype|st.name=name);
}
rule CopyProblemStatement
transform sps : Source!Class
to tps : Target!Class{
guard : sps.hasStereotype("Problemstatement")
}
Unfortunately, when I try to run this transformation, I receive an error, see the attached screenshot of the code and the error message.
I provide a detail description and minimum example concerning my project in a note and a zip file besides the screenshot of the code and the error message in the attachment to this message.
Any helpful hint is very much appreciated.
Kind regards, Alexander
|
|
|
|
| Re: [ETL] Error "Property 'stereotype' not found in object Class [...]" [message #1126310 is a reply to message #1125128] |
Sat, 05 October 2013 07:51   |
Alexander Fülleborn Messages: 32 Registered: April 2013 |
Member |
|
|
Hi Dimitris,
thanks a lot for your answer that indeed helped already to get on the right track. However, I now face the problem that the method "getAppliedStereotypes()" only finds the stereotype "class" instead of the additionally applied stereotype "problemstatement". Furthermore, I get some strange messages concerning the ambiguity of the element "Stereotype". In the following, I list my current ETL code:
rule CreateXDomainFromDomainSpecificProblemStatement
transform sps : Source!Class
to tps : Target!Class{
guard : sps.hasStereotype("problemstatement")
("Transform domain-specific problem statement '" + sps.getName() + "' to cross-domain problem statement...").println();
'Done.'.println();
}
operation Source!Class hasStereotype(name:String):Boolean {
var rc:Boolean;
rc = false;
self.getName().println();
var stereotypes:Sequence;
stereotypes = self.getAppliedStereotypes();
var stereotype:Stereotype;
stereotype.println();
name.println();
for (stereotype in stereotypes){
if (stereotype = name){
rc = true;}
}
if (rc = true){
return true;
}
if (rc = false){
return false;
}
}
I provide a zip file with the current project and in addition also an excerpt of the current epsilon log as a screenshot as an attachment to this message.
Another question: Where can I find the EPackage Registry view and the properties a Class has?
Thanks a lot for your very helpful support.
Alexander
[Updated on: Sat, 05 October 2013 07:55] Report message to a moderator
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07179 seconds