company logo

BaseContext :: executeFunction - Execute context function or expression

The function allows calling context functions or expressions. Usually, the function is generated automatically for each action in a context class. When writing your own implementation of executeFunction, you have to call the base class implementation of executeFunction to pass the request to the base class.

In order to execute function actions from within an application or another context class instance, executeAction should be called, which provides more flexibility and also supports actions implemented as OSI functions.

The function returns -1 when no appropriate function could be found. When the function had been executed successfully, the function returns 0, which usually indicates that not further processing is required (e.g. when handling events). In case of errors or incomplete processing, 1 will be returned. In this case, events calling the function are passed to the next event handler.

Action results to be returned have to be stored in the context result property.

When the context handle does not refer to a valid context instance the function throws an exception.

Return value:  Execution error ( int32  )

The value is usually returned from context functions or actions in order to report the result of execution. The variable may contain following values:

  • -1: function/action not executed
  • 0: function executed normally
  • 1-9: Function executed with errors. Error codes depend on the function/action called.

Implementation details

  1. Execute or check function
    int32 BaseContext  :: executeFunction ( odaba::String sFunctionName, bool bFunctionCheck )

    When passing true in bFunctionCheck, it is checked, only, whether the function passed in sName is supported or not. When passing false, the function is executed and the function throws an exception, when the context function is not supported, .

    • sFunctionName - Function name
    • bFunctionCheck - Check option

      In order to check, whether a context function is supported or not, this option should be set to true. When passing true, the function is not executed, but checked, only.

  2. to list
  3. Call context function
    int32 BaseContext  :: executeFunction ( odaba::String sFunctionName )

    The context function passed in sName is called. When the context function is not supported, the function throws an exception.

    • sFunctionName - Function name
  4. to list