Invoking an external system from an application

After configuring an action class to invoke an external system (via an invocation channel), you can configure a button in an application to trigger the invocation action. You can also extend the action class to display the results of the transaction in an application dialog box.

Before you begin

You must create an invocation channel and an action class before you add the invocation action to an application. If you intend to show the results of the invocation, create a Results (dialog) window in advance.

Procedure

  1. Open the application in the Application Designer application.
    The main object for this application must be same as the main object for the invocation channel and the action that you intend to call from the application.
  2. Add a Button Group control to the workspace from the Control Palette.
    The Button Group control automatically adds a Pushbutton control to the workspace.
  3. Click Properties to open the Pushbutton Properties window.
  4. Specify a name for the button in the Value field, for example Invoke External System.
  5. Specify the Control ID for the Results window in the Target ID field.
  6. Specify a method in the Value field that calls the invocation channel and redirects the results to the Results window.
    For example:
    InvokeChannelCache.getInstance().getInvokeChannel(channelName)
    .invoke(metaData, mbo, mbo.getMboSet(rel), action, null);

    Where:

    • The channelName value is the name of the invocation channel.
    • The mbo value is the name of the object.
    • The rel value is the name of the relationship (if applicable).
    • The action value is Add.