To run a transformation, complete one of the following steps:
eclipse -data workspace-path -application com.ibm.xtools.transform.core.transformationRunner -transformConfigs "[-R]transformation-configuration-path1,[-R]transformation-configuration-path2,..."
In the -transformConfigs parameter, you must specify the complete workspace path and configuration file name, not the file-system path name, of one or more transformation configurations.
Running a transformation from a command line suppresses all dialog boxes that the transformation generates.
eclipse -data /MyWorkspace -application com.ibm.xtools.transform.core.transformationRunner -transformConfigs "MyProject/MyConfig.tc"
eclipse -data /MyWorkspace -application com.ibm.xtools.transform.core.transformationRunner -transformConfigs "-RMyProject/MyConfig.tc"
eclipse -data /MyWorkspace -application com.ibm.xtools.transform.core.transformationRunner -transformConfigs "MyProject/MyConfig.tc, -RMyProject/MyConfig.tc"
IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(new Path("/MyWorkspace/MyConfig.tc")); try { ITransformConfig config = TransformConfigUtil.loadConfiguration(file); IStatus status = TransformController.getInstance().execute(config, null, false, null); } catch (IOException e) { // The config file could not be read. }
try {
URL url= new URL(platform:/plugin/myPluginID/myConfig.tc);
ITransformConfig config = TransformConfigUtil.loadConfiguration(url);
}
catch (MalformedURLException malURLEx) {
// Handle exception.
}
catch (IOException ioEx) {
// Handle exception.
}
| Ant script | Attribute descriptions |
|---|---|
com.ibm.xtools.umldt.buildTransformationConfiguration
Ant script:<?xml version="1.0" encoding="UTF-8"?>
<project name="myProject" default="build" basedir=".">
<target name="build">
<echo>Running transformation 'myProject/myConfig.tc' ...</echo>
<com.ibm.xtools.umldt.buildTransformationConfiguration
transformConfig = "myProject/myConfig.tc"
invokeTargetBuild = "incremental"
markerFailureThreshold = "error"/>
</target>
</project>
|
transformConfig: The path of the transformation configuration. This attribute is required. invokeTargetBuild:
An optional attribute that specifies the type of build to perform
on the target projects of the transformation configuration. If this
attribute is omitted (or has a value that is not in the list below)
no actions are performed on the target projects. Possible values are
as follows:
markerFailureThreshold: An optional attribute that specifies the minimum marker severity that should cause the task to fail. This attribute only applies if the invokeTargetBuild attribute is specified as incremental or full. Possible values are info, warning, and error. Other values are ignored. After each target project is built, the severity of the markers on that project are checked. The presence of a problem with severity no less than the value of this attribute causes the task to fail with a message that identifies the offending project. |
com.ibm.xtools.transform.core.runTransformation
Ant script:<?xml version="1.0" encoding="UTF-8"?>
<project name="myProject" default="generate" basedir=".">
<target name="generate">
<echo>Running transformation 'myProject/myConfig.tc' ...</echo>
<com.ibm.xtools.transform.core.runTransformation
transformConfig="myProject/myConfig.tc" reverse="false"/>
</target>
</project>
|
Replace the myProject variable with the name of your target project and the myConfig.tc variable with the name of the transformation configuration file being referenced in that project. For transformation types that support a reverse transformation, to run the reverse transformation, set the reverse attribute to true. You can run multiple transformations by specifying additional <com.ibm.xtools.transform.core.runTransformation> elements in the build.xml file. |
eclipse.incrementalBuild Ant script:<?xml version="1.0" encoding="UTF-8"?>
<project name="myProject" default="generate" basedir=".">
<target name="generate">
<echo>Running transformation ...</echo>
<eclipse.incrementalBuild
kind = "kind"
project = "myProject"
builder = "com.ibm.xtools.umldt.core.internal.builders.UMLDevelopmentBuilder"/>
</target>
</project>
|
kind: The kind of build
to perform. Possible values are as follows:
project: Replace with the name of the project to be built builder: The name of the builder to run; if this value is not specified then all builders are run |