Linking Transformation Configurations in RSA [message #627900] |
Thu, 27 August 2009 15:34 |
Roshan S. Messages: 125 Registered: July 2009 |
Senior Member |
|
|
Hi,
I've been using RSA 7.5.3 to create a custom model to model
transformation. I also wanted to link my transformation to a built in
transformation that is shipped with RSA.
As I understand it, in my Transformation provider I just need to add a new
Chain Rule to link it to an existing transformation. My problem is that
for a Chain rule I also need the Target Container as the second parameter.
Looking around I found it in the Transform Context and so I created a
class variable that is set in my validateContext(ITransformationDescriptor
descriptor, ITransformContext context) method and I just call my getter in
my Chain Rule instantiation. However, the validateContext method is
always run after my createRootTransform method (shown below).:
What is the correct way to retrieve the TargetContainer from either the
TransformContext or through some property that I don't know of?
/**
* Creates a root transformation. You may add more rules to the
transformation here
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param transform The root transformation
* @generated NOT
*/
protected RootTransformation
createRootTransformation(ITransformationDescriptor descriptor) {
return new RootTransformation(descriptor, new MainTransform()){
protected void addPostProcessingRules() {
add(new UMLProfilesConsistencyCheckRule());
//Run the UML to LDM transformation next
if(getTargetContainer() != null){
add(new ChainRule(UML2LDM, getTargetContainer()));
}
super.addPostProcessingRules();
}};
}
|
|
|
Powered by
FUDForum. Page generated in 0.03589 seconds