|
|
Re: [ETL] Error "Property 'stereotype' not found in object Class [...]" [message #1126310 is a reply to message #1125128] |
Sat, 05 October 2013 11:51 |
Alexander Fülleborn Messages: 132 Registered: April 2013 |
Senior 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 11:55] Report message to a moderator
|
|
|
Re: [ETL] Error "Property 'stereotype' not found in object Class [...]" [message #1126421 is a reply to message #1126310] |
Sat, 05 October 2013 14:43 |
|
Hi Alexander,
I've spotted two issues. First, your stereotyped is called "problem statement" instead of "problemstatement". As such your guard should look like this:
guard : sps.hasStereotype("problem statement")
Also, in "if (stereotype = name){" you're comparing a stereotype against a string. Your if statement should look like this instead:
if (stereotype.name = name){
Cheers,
Dimitris
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03691 seconds