[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.uml2] Linking Transformation Configurations in RSA

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();
}};
}