Studio:Accessing the Owner Side of a Function (API) Interface from Studio
This note describes how to use a STRIDE Studio interface dialog as the Owner end of a function call. The interface dialog makes it possible to register the dialog as the function's Owner and receive calls from any of the function's Users in an interactive fashion. For each function call, you can see the parameter values that the function was called with and enter return values directly.
Opening the Dialog
To open the Owner dialog for an interface, first select the Interfaces pane within the Workspace window and navigate to the function you wish to call.
Context Menu Method
To open the dialog via the context menu do the following:
- Right-click on the function label in the tree to bring up the context menu
- Select Open Owner Message from the menu
Hot Key Method
The dialog can also be opened using the keyboard, bypassing the context menu:
- Click on the function label in the tree to select the interface
- Type O (upper or lower case) on the keyboard
Dialog Contents
The Owner Interface dialog displays a source-level, owner format representation of the function. All Item cells are initially populated with default values (chosen by STRIDE Studio). You can enter data directly into the non-grey cells of the Item column. (You can enter a value in any cell, but in the case of the Owner dialog only the cells in the lower Output Data section will be marshaled back to the function User--e.g. the caller of the function.)
Entering Constrained Values
If an Item cell corresponds to an enumeration or other constrained value, the cursor will show a small box with a downward pointing arrow when hovering over the cell. Double-click on the cell to activate a drop list (or combo box) from which you can select the appropriate value.
Registering as the Function Owner
In order for the STRIDE runtime to route function calls to the dialog, you must register the dialog as the function Owner. This is done by toggling the Register toolbar button.
When the button is in the down position, the dialog is registered as the owner. When the button is in the up position, the dialog is not the registered owner.
Returning From the Function
Manual Operation
When the function has been called and return from the function is pending, the Return toolbar button will become enabled . To return from the function, click the button. The current values of all Output Data Items will be marshaled and returned to the caller.
If additional function calls arrive before you return from the current call, the new calls will be queued by the runtime and presented as soon as you return from the current call.
Automatic Operation
You can set the dialog to return automatically (without pressing the Return button), by toggling the Auto Return toolbar button . When the button is in the down position, returns will occur automatically, when the button is in the up position, you must manually press the Return button to return from the function.