ColdFrame: Extraction of models from Rose

Rose keeps your model in a .mdl file. It's probably a good idea to keep the individual domains in separate .cat files; you do this in Rose by making them 'controlled units'.

ColdFrame needs the individual domains to be extracted to .raw files for further processing. There are two ways of doing this.

Extraction from within Rose

The Rose model is extracted to a raw "domain definition file" (type .raw) using a RoseScript script extractor.ebs.

Because extractor.ebs may change in future releases of ColdFrame, an intermediate script extractor-trampoline.ebs is provided, which uses environment variables TOP and COLDFRAME (typically set to C: and cf-yyyymmdd respectively, see the installation notes) to locate extractor.ebs.

Copy extractor-trampoline.ebs to the Rose script directory (typically C:\Program Files\Rational\Rose\).

Call extractor-trampoline.ebs from the Rose Add-ins menu (or whichever other one you want to use). In C:\Program Files\Rational\Rose\ or thereabouts, edit rose.mnu:

Menu Add-Ins
{
  Separator

  option "Generate &XML..."	
   {
	RoseScript $SCRIPT_PATH\extractor-trampoline.ebs
   }

}

(this is available in the distribution in file rose-addin.mnu).

The Extractor extracts data for the selected Domain packages or, if none are selected, for all the packages on the current active class diagram (if any). A recommended approach is to have a diagram (called Code Generation, perhaps) and drag all the Domain packages in your model onto it.

You can select packages to be extracted in the Code Generation diagram.

You may find it helpful to have the domain package on the class diagram you're working on, so you don't have to leave it.

The extracted domain definition file name is the domain name with underscores substituted for spaces.

You can specify the output file location using the environment or Rose Path Map variable COLDFRAMEOUT (the Rose Path map version takes precedence if both are defined). The default output file location if COLDFRAMEOUT isn't specified is the directory that extractor.ebs was loaded from (sorry about that). Double-clicking on the .mdl file or using the "recent documents" facility of Windows opens Rose with a more useful default directory.

The output format is XML, using a schema designed to be easy to output from RoseScript and to handle in the next stage using a SAX-compliant parser.

Extraction using cat2raw.py

Provided you keep each domain in its own .cat file, you can convert the .cat to .raw format using the Python script cat2raw.py.

This script depends on the PLY parsing library.

Its usage is

   $ python cat2raw.py -h
   cat2raw.py $Revision$
   usage: cat2raw.py [flags] [input cat file]
   flags:
   -h, --help:              output this message
   -o, --output=PATH:       the output path/file (default is ./domain_name.raw)
   -r, --reversionary-mode: output to previous standard (20040319)


Simon Wright