Getting Started

Writing IDL files

We will start from writing the idl file for each component.
  1. Create a directory named MyQuoter.
  2. In MyQuoter directory, create one directory Stock_Base for the base idl and two more directories Broker, Distributor for each component. In MyQuoter/Stock_Base, place an idl file Stock_Base.idl that you could copy from here. This file defines the interfaces and events that will be used by both Stock Distributor and Stock Broker.
  3. We put together the common interface definitions so the base library can be shared by both components, reducing the size of "real" components.
  4. In MyQuoter/Distributor, place an idl file Distributor.idl that looks like this. This file defines the StockDistributor component interfaces.
  5. In MyQuoter/Broker place an idl file Broker.idl that looks like this. This file defines the StockBroker component interface.

Importing IDL to PICML

   To quick start our Stock Quoter modeling process in GME, CoSMIC introduces idl_to_picml , which is an executable program that imports the IDL files you just created into PICML.
  1. Make sure %COSMIC_ROOT%\bin is included in the PATH variable, e.g., c:\Program Files\ISIS\CoSMIC\bin.
  2. Open a command prompt, run VCVARS32.BAT from the MSVC .NET folder if you haven't done so. It will set the environment for using Microsoft Visual Studio .NET tools so that idl_to_picml works properly.
    in my machine, VCVARS32.bat is in C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin
  3. In the same command prompt, change directory to MyQuoter\, and type the following command:
       > idl_to_picml -x MyQuoter -r . -I .\Stock_Base
       (if the above command does not work, you may also try this
       >idl_to_picml -x MyQuoter -r . -I .\Stock_Base -I %TAO_ROOT% -I %TAO_ROOT%\orbsvcs -I %CIAO_ROOT%\ciao)
      idl_to_picml will parse your IDL files and generated a MyQuoter.xme file in the MyQuoter directory. Note that if -x option is not used, the default xme file name will be PICML_default_xme_file.xme.
    4. Start GME, select File->Import xml.., and choose the xme file just generated. You should be able to see an imported PICML model similar to the one shown in Figure 2.



Figure 2

  In the Browser of the generated model, the PredefinedTypes folder contains a bunch of atomic datatype elements that will be referenced by other modeling parts later. You don't have to worry about them for now. The models in InterfaceDefinitions folder are the PICML representations ofthe IDL files you just imported. Double-click to open Broker, it will show you a white, document-like entity which represents a <<FileRef>> instance and a yellow box-shaped entity representing a <<Package>> instance. Their equivalent representations in IDL files are "#include" and "module" respectively. Figure 3 gives you a clear view of GME representation of all the 3 idl files created. We will cover the other folders in the next section.



Figure 3

Now we are ready to model the rest of the Stock Quoter systems.




Ming Xiong
Last modified: