ATL issue [message #559579] |
Fri, 17 September 2010 09:19 |
Kosala Yapa Messages: 159 Registered: September 2010 |
Senior Member |
|
|
Hi,
I have two classes, Requirement and Constraint.
I want to write ATL program, to map requirements,
when Requirement.compOperator=equal, then
Requirement.Context -> Constraint. equal. op1
Requirement.Value->Constraint.equal.op2
when Requirement.compOperator=lessThan, then
Requirement.Context -> Constraint. lessThan. op1
Requirement.Value->Constraint.lessThan.op2
I tried to define a helper and use it in a rule, but not working. I am not clear about how to define helpers and their use.
can someone give me any hint/sample?
Requirement=>
package Requirement{
class Requirement{
attribute Context : String;
attribute compOperator : String;
attribute Value : String;
}
}
package PrimitiveTypes{
datatype String;
}
Constraint=>
package Constraint {
class Constraint {
attribute compOperator : String;
attribute op1t : String;
attribute op2t : String;
}
class equal{
attribute op1: String;
attribute op2: String;
}
class lessThan{
attribute op1: String;
attribute op2: String;
}
}
package PrimitiveTypes {
datatype String;
}
Thank you.
Kosala
|
|
|
Powered by
FUDForum. Page generated in 0.03526 seconds