Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic TAU (steve huntington)
Decrease font size
Increase font size
Topic Title: how to extend TTDApplicationBuilder::build ?
Topic Summary: how to access the model from a custom code generator launched from Artifact->Generate?
Created On: 27-Mar-2007 05:05
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 27-Mar-2007 05:05
User is offline View Users Profile Print this message


Thomas Cottenier

Posts: 2
Joined: 27-Mar-2007

Hi,
I created a profile that extends TTDApplicationBuilder::build and sets the command to a my executable.
I can create custom Artifacts, which launch my code generator using the Generate/Build commands.

Yet, I am not able to access the model from there.
The executable doesn't receive any arguments.
ModelAccess->GetProjectItem doesn't do it either.

I noticed that the other built in code generators first proceed by generating some CGI xml file.
Any ideas about this?

Eventually, I would like to be able to launch the code generator from taubatch. The reason for this is that I would be able to leverage the taubatch "--rebind-by-name" option, before code generation.
Thanks,
Thomas

Report this to a Moderator Report this to a Moderator
 13-Apr-2007 13:31
User is offline View Users Profile Print this message


Mattias Mohlin

Posts: 4
Joined: 29-Aug-2003

Did you read the on-line help chapter called "Adding Code Generators?" (Customizing Tau - Customizing Telelogic Tau)
The method described (briefly) there is the recommended way of adding new custom code generators.
In short the technique is to use a standard executable (ABWGen.exe) as code generator container, and then implement the code generator behavior as an agent which will execute inside that container.
Using this technique saves you from several difficult steps which are needed if a completely custom code generator executable is used. For example, the parsing of input XML (CGI = code generator input), the loading of the project file and all libraries, the binding of the model and so on.
Report this to a Moderator Report this to a Moderator
 13-Apr-2007 18:11
User is offline View Users Profile Print this message


Thomas Cottenier

Posts: 2
Joined: 27-Mar-2007

Mattias,
Yes. I do have versions of my code generator as an agent and as a batch.
Also, I was able to make it work by extending the TTDApplicationBuilder::build too.
I use the "file" and the "BuildArtifact" CGIar entries.

Unfortunatly, this does not solve my problem. The problem is really with the LoadProject command. It is too sensitive to checking errors. For example, it would refuse to load a project that contains checking errors that relate to Diagram elements or informal elements. Also, it does not run the Auto Update.

I would like to be able to load models in the same way as taubatch (if taubatch does not complain, my code generator should not complain either).

Right now, I use a workaround by pre-processing the models with a tcl script that is launched using the tau <myproject.ttw> -script cleanup.tcl

The script deletes all diagrams, usecase and informal entities in the model and calls u2::Check to auto update bad references, end terminates by killing the tau process.
The problem with this solution is that it brings up the TAU user interface - and there is also a danger that it would hang for some reason (when TAU prompts the user for example).

Also, it forces me to make a copy of the model (recursively retrieving all .u2 files and copying...) before running the code generator.

An ideal solution would be to hook into taubatch, let taubatch load the model and operate directly on the object model without having to perform a LoadProject or a LoadFile.

Thomas
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic TAU forum.
There are currently 1 users logged in.
The most users ever online was 15 on 31-Mar-2008 at 16:22.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.