Book a Demo

Author Topic: List of all available transformations via API  (Read 2883 times)

emulov

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
List of all available transformations via API
« on: August 24, 2010, 06:03:17 pm »
We are currently working on an addin which allows to invoke several model transformation in an chained manner, based on an XML configuration file.

The invocation of a model/code transformation via the command

repository.GetProjectInterface().TransformPackage(templateName, sourceID, targetID, "")

works fine. However, we would like to warn the user, if he/she tries to invoke a transformation template, which does not exist.

Is there a way to find out which transformations are stored in the repository using the API? I could not find an appropriate method for this.

Philipp

emulov

  • EA Novice
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: List of all available transformations via API
« Reply #1 on: August 27, 2010, 06:52:57 pm »

After a discussion with Sparx Support I found out that there is no method available in order to retrieve all stored transformation.

However, you may manually run an SQL script using the query

SELECT DISTINCT TemplateType FROM t_template WHERE TemplateType LIKE '*_Transform_Template'

Removing the string "_Transform_Template" from the end of these return values should provide the transformation names.

Built-in transformation types (C#, DDL, XSD, WSDL, Java, JUnit, NUnit) could perhaps just be hard coded into your script.

Thanks to Aaron Bell from Sparx for the hint!