Configuring Insert Service
An Insert service inserts a new record into the dataset. You configure Adapter for Terracotta DB services using
Designer. For more information about adapter services, see
Using Adapter Services.
Read the section
Before Managing Adapter Services, before you configure adapter services.
To configure an adapter service using the Insert template
1. In Designer, right-click the folder in which the service is to be contained and select New > Adapter Service.
2. Select the parent namespace, type a name for the adapter service, and click Next.
3. Select webMethods Adapter for Terracotta DB as the adapter type and click Next.
4. Select the appropriate Adapter Connection Name and click Next.
5. From the list of available templates, select the Insert template and click Finish.
The adapter service editor for the selected adapter service appears. You can select the Adapter Settings tab at any time to confirm adapter service properties such as the Adapter Name, Adapter Connection Name, and Adapter Service Template as necessary.
6. Select the Dataset tab to configure the following fields:
Field | Field Description/Action |
Dataset Name | Specify the name of the dataset in TCStore. |
Key Type | Specifies the key type which is auto populated based on the selected dataset. |
Input Key Type | Specify the input key type. |
Sampling Limit | Specify the number of records to be scanned to the metadata of the cells. These cell definitions are listed in the Insert tab. The Input values are integers and it must be greater than 0. For example, if you provide sampling range as 10, then the service scans 10 records of the selected dataset and displays the cell definition for those 10 records. |
IS Document Reference | Specify the IS Document namespace. The IS Document reference is of the format: folder1.folder2:Documentname Note: Each field in an IS Document is considered as an individual cell and the Cell Name is auto-populated. |
7. Use the Insert tab to define the cell definitions using the following fields:
a. Use the icon to create a new row as needed. You can use the icon to fill in all cell definitions to the table that are retrieved after scanning the dataset for specified Sampling Limit. Additionally, the second table will have the below fields with respect to the provided IS Document in the Dataset tab and the fields for the third table can be entered manually. Use the following fields:
Field | Description/Action |
Cell Name | Specifies the cell name in the record of a dataset. |
Cell Type | Specifies the cell type in the record of a dataset. The supported data types are: INT, LONG, DOUBLE, STRING, CHAR, BOOL(Boolean), BYTES(byte array). |
Input Field | Specifies the input field name. |
Input Field Type | Specifies the data type of the input field. |
The input variables are grouped under the document called value
Note: Be sure to have unique cells across the tables in the Insert tab.
.
8. To verify input or output information for the service, use the Input/Output tab as required.
The below field is auto generated under input section of Input/Output tab:
Field | Description/Action |
key | Specify the key of a Record. |
value | Specifies the document which contains fields that needs to be inserted. |
$datasetName | Specify the dataset name. Optional field, where the specified value overrides the configured value in the Dataset tab. |
The below field is auto generated under output section of Input/Output tab:
Field | Description/Action |
success | Specifies the result of the service. It can either be true or false. |
9. From the File menu, select Save.
To store the entire IS Document in a cell, perform the following:
You can store the entire IS Document as a string in TCStore. For this, you have to select the Input Field Type as IData. When the Cell Type is a string and the Input Field Type is an IData, the
Adapter for Terracotta DB converts the IS Document to JSON string and stores in TCStore as a string.
You can store the entire IS Document as Bytes in TCStore. For this, you have to select the Input Field Type as IData. When the Cell Type is a byte and the Input Field Type is an IData, the
Adapter for Terracotta DB converts the IS Document to byte array and stores in TCStore as bytes.