company logo

Implementing OSI methods

Implementing OSI methods is possible by external creating external script files, which might be called directly by running the OSI interpreter ( OSI utility) or using the OShell osi command.

When implementing OSI in several external script files, one may also use the LoadOSILibraries() function, which may be called, when running OShell or OSI utility before calling the function.

More comfortable is using the ClassEditor , which also allows mixing e.g. C++ functions with OSI functions in the same class. Thus, one may easily change from OSI implementation to e.g. C++, when this performs better. Moreover, the ClassEditor provides a check function for checking OSI functions before calling them.

// loading OSI script files

cd mydb

  osi do

  dictionary.loadOSILibraries("my_OSI_dir");

  myClass.myOSIFunction();

  end

...

OSI and other languages

In order to combine OSI functions with other programming languages, the are two directions possible. Calling OSI functions is supported in C++ as well as for .NET languages by calling executeExpression() .

Calling .NET or C++ functions from within OSI functions becomes always possible by calling context class actions. Within a (typically) type context class one may implement an action (function marked as action). This may be called by means of context class function executeAction() . This serves as interface to function calls of different programming languages but also to other kind of actions (e.g. GUI action).

In order to call C++ functions from within an OSI function, one may provide an OSI interface for the C++ class.

... fragment my_OSI_Function (SET<Person> &person)

{

  if ( person.selected )

    person.typeContext.executeAction("myCPPAction");

}