8. The OMI file

The OMI file defines the entry point to a LinkableComponent. It contains information on the software unit to instantiate and the arguments to provide at initialization. This file makes it possible for a user interface to deploy your model.

This chapter describes the OMI file.

The OMI file refers to a specific instance of your LinkableComponent. E.g. if you have an OpenMI compliant river model setup for the River Rhine, the OMI file relates to this specific instance (the River Rhine). OMI files are typically created by the user interfaces of the model. So when the user saves the setup files also the OMI file is saved at the same location as these files.

8.1 Structure of the OMI file

The structure of the OMI file is defined in OpenMI.Standared.LinkableComponent.XSD. (http://www.openmi.org/schemas/LinkableComponent.xsd) Figure 21 provides a visual representation of the schema definition; The XML listing below provides an example of an OMI file.


Fig. 21. Visual representation of the LinkableComponent XML schema definition.

OMI file Example (the simple river):

<?xml version="1.0"?>
<LinkableComponent Type="Oatc.OpenMI.Examples.ModelComponents.SimpleRiver.Wrapper.SimpleRiverOpenMIComponent" Assembly="..\Wrapper\bin\Debug\Oatc.OpenMI.Examples.ModelComponents.SimpleRiver.Wrapper.dll">
  <Arguments>
    <Argument Key="FilePath" ReadOnly="true" Value= "" />
   </Arguments>
</LinkableComponent>

If your OpenMI components are located in the GAC you will need a bit more information in the OMI file. Below you can see an example for the Mike11 model setup for the Karup creek in Denmark.

<?xml version="1.0"?>
<LinkableComponent Type="DHI.OpenMI.Mike11.Mike11LinkableComponent" Assembly="DHI.OpenMI.Mike11, Version=1.0.0.0, Culture=neutral, PublicKeyToken=c513450b5d0bf0bf" xmlns="http://www.openmi.org/LinkableComponent.xsd">
<Arguments>
<Argument Key="SimFile" ReadOnly="true" Value="C:\Users\Gregersen\Documents\OpenMI\Meetings\2008.06.05.Wallingford.CEH_WS\Data\FileMike11\MIKE11\karup.sim11" />
</Arguments>
</LinkableComponent>

See also: HOW TO work with OMI files

  • No labels