Service

Overview

The ServiceWorkEntryExecutor class creates XML requests from the source to target mappings and invokes EPM services to add, update, or delete the target data. For more information on how to map these actions, see Service Action Mapping.

Select a Target Level mapping and Target Types table set, and create an appropriate SELECT … template statement for this executable class.

Read requests

This executable can issue READ requests without updating the target service data. However, it can log the responses from the service and can be used to test what a service’s XML or JSON would look like. The responses can be logged as run status messages using the ResponseOnlineLogLimit parameter so that they can be viewed online. See Parameters for more information.

For more information on how to map these actions, see Service Action Mapping.

Parameters

This executable class accepts the following parameters:

Parameter Description
authTask

Specifies the details for authentication, such as user ID and password, and the request for a token.

For remote service calls, you can specify an authentication task to authenticate and obtain a token. If needed, the authentication task can be linked to other authentication tasks. See AuthWorkEntryExecutor.

errorTolerance

Specifies the number of tries before a failing service execution is aborted. During the retries, all the exception messages are written to the UA_RUN_TABLE_ERROR table and associated with the legacy primary key. This allows you to view the errors through Report when the run ends.

The errorTolerance can only be set to a number greater than 0 if the commit count is 1. This ensures that when an error occurs and a rollback is issued, only the entity in error gets rolled back.

Default: 0 or the value of com.ria.converter.service.errorTolerance property

fastAdd

Executes add requests in fast mode.

This means that requests are executed asynchronously and can cause updates to the legacy id to be lost. For conversion tasks where the CX…ID must be updated with the legacy id, set this parameter to false.

Default: false or the value of com.ria.converter.service.fastAdd property

fastUpdate

Executes update requests in fast mode.

Default: false or the value of com.ria.converter.service.fastUpdate property

filepath

Defines the file path of the output requests for invokeMethod or local.

A filepath can contain any of the following embedded variables to create unique filenames:

  • {$currentDate} — YYYYMMdd
  • {$currentTime} — HHmmss, where HH is in 24-hour format
  • {$currentDateTime} — YYYYMMddHHmmss
  • {$currentTimestamp} — YYYYMMddHHmmssSSS, where SSS is milliseconds
h:<header>

Specifies any request headers for remote service calls.

The header names are case-insensitive. For example, h:Content-Type and h:content-type are equivalent.

Duplicate header names are not permitted.

h:Content-Type

Specifies the format used to send requests for remote service calls. Possible values are:

  • application/xml
  • application/json

Default: application/xml

h:Accept

Specifies the format the tool expects the responses to be in.

Currently, only application/xml format is valid as DIH uses XML DOM and XPath to inspect the responses.

invokeMethod

Specifies how DIH invokes requests. Possible values are:

  • local — Enables direct service calls within the same JVM.
  • remote — Makes REST calls over HTTP, so other remote parameters, such as authTask and serverUrl, are required.
  • file — Builds service requests
language

Specifies a valid language code, such as ENG for English.

Default: value of the com.ria.converter.service.language property

Mandatory: Yes

user

Specifies the user id used for the service requests in local invoke method.

Default: value of the com.ria.converter.service.user property

Mandatory: Yes

maxRequestLogSize

Defines the size limit of the XML request in the log.

You can set the parameter value to any integer. For no logging, set it to 0. For no limit, set it to -1.

Default: -1 or the value of the com.ria.converter.service.maxRequestLogSize property

maxResponseLogSize

Defines the size limit of the XML response in the log.

You can set the parameter value to any integer. For no logging, set it to 0. For no limit, set it to -1.

Default: 2000 or the value of the com.ria.converter.service.maxResponseLogSize property

readResponseOnlineLogLimit

Specifies the maximum number of read responses to log to the run status.

Set the parameter value to any integer to prevent the run status from being flooded with read response messages. For no logging, set it to 0. For no limit, set it to -1.


Default: 10 or the value of the com.ria.converter.service.readResponseOnlineLogLimit property

serverUrl

Specifies the base URL of the target REST server for remote calls.

The URL from the configrued Service will be appended to the serverUrl to form a completer URL.

traceCallData Writes the requests and responses of the valid calls to the UA_RUN_SERVICE_TRACE table. This table can be queried for validation purposes, or to simply trace calls for debugging.

For more information on other variables and syntax that can be used, see Common executable features.

Service file export template

A Data Block is defined on the service’s Task and can be used to specify a template for a file export. Without a data block on the task, the specified template on the file upload uses the Code Block sequence #2 of the service Executable. The template specified in the Task takes precedence over the template in the Executable. If neither is specified, the requests will be exported one request per line in the output file.

The format for the request in the template is {request(%s</tags)}. Other elements can be specified around this and inside the round brackets. For example:

<root>
{request(<payload>%s</payload>)}
</root>

Everything between the () in the {request…}reference will be used to generate each request. Anything outside of the {request…} reference will be generated once.