Use Code Templates

The VS Code extension for Rapid Adapter Builder provides code snippets as templates to help you author an adapter definition document.

There are templates available for various sections of the adapter definition document, such as connections, triggers, actions, and so on. To author a section in a document, you can use the corresponding template and update it with your details, without having to write the code from scratch.

To use a code template, open an adapter definition document in the VS Code editor.

  1. In VS Code, click Explorer Explorer icon on the sidebar.
    The directory structure of your workspace folder is displayed.
  2. Within the definitions directory listing, click the adapter definition document that you want to work on.
    The document is displayed in the VS Code editor.
  3. See the following topics for details on each code template and how to use it in your document:

Use Authentication Scheme Templates

The VS Code extension provides code templates for a number of authentication schemes. You can use these templates to quickly define a security policy in the connection section of an adapter definition document.

Select and use the required authentication template for your document.
  1. Right-click anywhere in your document to view the context menu, and then click RAB: Insert Authentication Scheme.
    A list of authentication schemes is displayed.
  2. Select an authentication scheme from the list to insert the corresponding template into your document.
    Under the connection object of your document, the connectionProperties and securityPolicies sections are populated as per the template.
  3. Update the values in these sections according to your requirements.

Note:

Consider that you model an authentication scheme for your adapter and deploy the adapter to Oracle Integration. At a future time, if the target application for your adapter deprecates the authentication scheme you have used, append a new authentication scheme in your adapter definition document. Do not delete the earlier authentication scheme as it breaks the backward compatibility. Instead, you can rename the earlier authentication scheme to indicate that it has been deprecated.

Use the Test Connection Template

The VS Code extension provides a code template for testing a connection. You can use this template to quickly define a test-connection flow in the flows section of an adapter definition document.

  1. Right-click anywhere in your document to view the context menu, and then click RAB: Insert Test Connection Flow.
  2. In the dialog box that appears, click Yes to confirm your action.
    A test statement is inserted in the connection section, and a corresponding flow is inserted in the flows section of the document.
  3. Update the values in the inserted flow according to your requirements.

Use the Action Code Template

The VS Code extension provides a code template for action definitions. You can use this template to quickly define an action in the actions section of an adapter definition document.

  1. Right-click anywhere in your document to view the context menu, and then click RAB: Insert New Action.
  2. In the Enter an Action ID dialog box, enter a name for the action and press Enter on your keyboard.
    A new action definition is inserted in the actions section, and a corresponding flow is inserted in the flows section of the document.
  3. Update the values in these sections according to your requirements.

Use the Trigger Code Template

The VS Code extension provides a code template for trigger definitions. You can use this template to quickly define a trigger in the triggers section of an adapter definition document.

  1. Right-click anywhere in your document to view the context menu, and then click RAB: Insert New Trigger.
  2. In the Enter a Trigger ID dialog box, enter a name for the trigger and press Enter on your keyboard.
    A new trigger definition is inserted in the triggers section of the document.
  3. Update the values in this section according to your requirements.