Rest Service Application Rule

This Application Rule is used to call any Rest services (internal or external) in your Process flow.

Figure 4-13 Rest Services Rule Details window


This image displays the Rest Services Rule Details window.

Table 4-9 Rest Services Rule Details Description

Field Name Description
Name Enter a unique name for the Application Rule.
Rule Type

Select the Rule Type from the drop-down list.

This Application Rule can be used as a Decision Rule, Execution Rule, or Selection Rule based on your requirement.

Execution Type Displays the Application Execution Type as Rest service.
Method Type Select the method type from the drop-down list. The options are GET and POST.
URL

Enter the REST URL that needs to be called.

For example, <IP Address/hostname of the Web Server >:<servlet port>/<context name>/restPMF/PMFService/startWorkflowProcess (A rest URL to start the workflow).

Authorization Type

Select the authorization type from the drop-down list. The options are:

  • No Auth- Select this option for the rest services that do not need an authorization header.
  • Basic Auth- Select this option if you want to authenticate the invocation of the Rest service.
Authorization

This field is displayed only if you have selected Basic Auth as Authorization Type.

  • In the case of OFSAA local user, enter the User ID only.
  • In the case of an external user, enter the base 64 encoded string. For more information, see Authentication of Rest Service.
  • In case this field is left blank, logged-in user credentials will be taken as authorization header.

Note: If Authorization is given in the Header explicitly, then it will take preference over the value given in the Authorization field.

Query Param

Enter the Query Parameters that need to be passed to the Rest API.

For example, http://example.com/foo?bar

Headers

Enter any headers that need to be passed to the Rest API.

For example, "content-type": "application/json"

To pass the header values dynamically, use the following format:

{Content-Type:~~TYPE~~,Authorization:~~CREDENTIAL~~}

Where TYPE and CREDENTIAL are data fields.

Data

Enter if any actual data that needs to be passed to the Rest API. Data can be of type RAW, JSON, Form Data, and so on.

For example, "{\n \"objectid\":\"912\",\n \"objecttype\":\"1000\",\n \"infodom\":\"OFSCAPADQINFO\",\n \"segment\":\"OFSCAPADQINFO\",\n \"userid\":\"ORMUSER\",\n \"locale\":\"en_US\",\n \"securityMap\" :{},\n \"applicationParams\" :{\n \"testparam\":\"value1\",\n \"testparam2\":\"value2\"\n }\n \n}

Return Parameter

Select the Data Field which will receive the return parameter of the Expression, from the drop-down list.

  • For Execution Rule type, the business logic is implemented in the method and the parameter value returned from the Application Rule is saved in the mapped Data Field.
  • In the case of Selection Rule type, the Application Rule should be a String value.
  • In the case of the Decision Rule type, the Application Rule should return Boolean values “True/False”.
Scope Select the Scope as Process to use the Application Rule only in the current process or Package to use the Application Rule across all the processes in the package.
Is Proxy required Select Yes if a proxy is required for the Rest Service. That is if the Rest API is outside OFSAA. For information on how to enable proxy, see Enabling Proxy for the REST Service Application Rule section.