Configuring services for custom and hang-off APIs

The APIs generated for custom or hang-off entities by the application can be invoked as a service and through a multiAPI wrapper component. For more information on invoking the APIs through a multiAPI component, refer to the Javadocs. The service configuration user interface has to be enabled to configure these APIs.

Service Configuration Interface

To include custom APIs, you can create a service definition as shown in the figure. The configuration fields are explained in the following table.

Field Name

Description

General Tab

Standard API

Select this option if a standard application API is to be invoked. If selected, the standard API Name drop down list displays. For each API, the Class Name and Method Name are provided and cannot be edited.

Extended API

Select this option if a custom Java™ code is to be invoked.

Extended Database API

Select this option if the service invokes a custom or hang-off API. If selected, a custom API Name drop-down list displays. For each API, the Class Name and Method Name are provided and cannot be edited.

Note: If you want to lock a record in a custom table, pass the SelectMethod attribute as part of the input XML to the custom entity API. The locking happens within the transaction boundary of the custom API call.
The SelectMethod attribute can take the following values:
  • WAIT
  • NO_WAIT
  • NONE
Note: SelectMethod attribute is supported only for getAPI. Ensure that you verify the input xml of getAPI if the SelectMethod attribute is exposed.

API Name

Select or enter the API to be called.

Class Name

Specifies the class to be called.

Method Name

Specifies the method to be called.

Requires Backward Compatibility

Select this field to indicate that input data coming through the API is from a previous version (only applicable to system APIs).

Version

If you chose Requires Backward Compatibility, select the application version the API is to behave as. Only the applicable versions for the individual API display.

Arguments Tab

Argument Name

You can pass name/value pairs to the API by entering the values in the Arguments Tab.

In order for custom APIs to access custom values, the API should implement the interface com.yantra.interop.japi.YIFCustomApi.

If entered, these name/value pairs are passed to the CustomApi as a Properties object.

Argument Value

Enter the argument value.

Template Tab

When system APIs are invoked, you can specify an output template to be used by the API. You can specify the template in the configuration properties of the Service Definition, the Resource Definition in the Resource Hierarchy tree, or both. However, if the template has been specified at both definition levels, the template specified in the Service Definition is used.

XML Template

Select this radio button to construct the XML to be used for the API output. Enter the template root element name and click OK. You can then construct the XML.

File Name

Select this radio button to enter the filename of the XML file to be used as the API output template. This file should also exist in your CLASSPATH.

Facts Tab

 

A Fact is an attribute that is used by an API or an agent to identify which colony to connect to and retrieve data from. Based on the fact name and fact value entered, the corresponding colony is determined.

Fact Name

Enter the fact name of the XML attribute.

Fact Value

Enter the fact value of the XML attribute.