Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titleplugin.xml
   <extension
         point="de.cau.cs.kieler.kico.transformation">
      <transformationGroup
            id="NORMALIZE"
            dependencies="TRIGGEREFFECT, SURFACEDEPTH"
            name="Transform All Normalize">
      </transformationGroup>
   </extension>
   <extension
         point="de.cau.cs.kieler.kico.transformation">
      <transformationMethod
            class="de.cau.cs.kieler.sccharts.extensions.SCChartsCoreTransformation"
            id="TRIGGEREFFECT"
            method="transformTriggerEffect"
            name="Transform Trigger and Effect">
      </transformationMethod>
   </extension>
   
   <extension
         point="de.cau.cs.kieler.kico.transformation">
      <transformationMethod
            class="de.cau.cs.kieler.sccharts.extensions.SCChartsCoreTransformation"
            id="SURFACEDEPTH"
            method="transformSurfaceDepth"
            name="Transform Surface Depth">
      </transformationMethod>
   </extension>
   
   <extension
         point="de.cau.cs.kieler.kico.transformation">
      <transformationGroup
            id="ALL"
            dependencies="CORE NORMALIZE"
            name="Transform All">
      </transformationGroup>
   </extension>

 

Compilation

textOnce a bunch of model transformations are registered, these can simply be called using the KiCo central "KielerCompiler" class with its method compile(). This will be given a List<String> of transformation IDs or a comma separated String of transformation IDs as the first parameter. The second parameter is the EObject that is being transformed. It should meet the signature of the first model transformation called. Note that the actual model transformations that are done may vary because KiCo will automatically inspect the dependencies of each transformation requested (deep-recursively). If you do not like this to happen as an advanced user you can use a third parameter that will skip this autocompletion. Note that if you switch this off also NO transformation groups can be processed. Here is an overview and examples how to use the compile() method:

MethodDescription
EObject KielerCompiler.compile(List<String> transformationIDs, EObject eObject)
  • transformationIDs: List of Strings representing the transformation IDs and a pre-ordering. Note that KiCo may automatically modify the order to meet the dependencies of the referenced transformation IDs or transformation group IDs.
  • eObject: The EObject that is the input to the compilation process.
  • Returns: The EObject returned from the last model transformation called by KiCo.
EObject KielerCompiler.compile(String transformationIDs, EObject eObject)
This is a convenient method only which can be used to give transformation IDs or transformation group IDs as a comma separated String. For eObject and the return value see above.
EObject KielerCompiler.compile(List<String> transformationIDs, EObject eObject, boolean autoexpand)
This is an advanced compile method which can turn of auto-expansion with the last parameter. Use this with care! Note that if switching autoexpand off you cannot use transformation group IDs any more. Also no dependencies will be considered. The transformations will be applied straight forward in the order defined by the transformationIDs list.

Examples

Code Block
titleJava Code
import de.cau.cs.kieler.kico.KielerCompiler;
...
private MyEObjectClass myMethod(EObject eObject) {
	...
	transformed = (MyEObjectClass) KielerCompiler.compile("ABORT, SIGNAL", eObject);
	...
	return transformed 
}
Code Block
titleXtend Code
import de.cau.cs.kieler.kico.KielerCompiler
...
def dispatch MyEObjectClass myMethod(EObject eObject) {	
	transformed = KielerCompiler.compile("ABORT, SIGNAL", eObject) as MyEObjectClass
	...
	transformed 
}