Rest Service Application Rule

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

 

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 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 rest services that does not need authorization header.

·       Basic Auth- Select this option if you want to authenticate the invocation of Rest service.

Authorization

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

·       In case of OFSAA local user, enter the User ID only.

·       In case of an external user, enter the base 64 encoded string. For more information, see Authentication of Rest Service section.

·       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 than the value given in the Authorization field.

Query Param

Enter the Query Parameters that needs 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 ExecutionRule 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 case of SelectionRule type, the Application Rule should be a String value.

·       In case of DecisionRule 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 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.

 

Enabling Proxy for the REST Service Application Rule

This section explains how to configure the Proxy details if it is required for the Rest Service Application Rule.

Add the following entries in the AAI_WF_GLOBAL_SETTINGS table:

 

V_PARAM_NAME

V_PARAM_VALUE

Description

PROXY_SERVER_IP

For example, www.proxy.myserver.com

Provide the IP address of the Proxy server.

PROXY_SERVER_PORT

For example, 80

Provide the port number of the Proxy server.

 

Authentication of Rest Service

Basic auth is supported for authentication of the rest service. You have to encode your username and password using the Online encoder (https://www.base64encode.org/) and add the encoded value in the Authorization field in the Rule Details window.  The format of the user name and password to be entered in the online encoder should be username:password. For example, if we give DAVID_MLRO:oracle1, it will be converted to "REFWSURfTUxSTzpvcmFjbGUx".

You can also add this as a parameter V_PARAM_1 in the AAI_WF_APPLICATION_API_B table. This needs to be entered as given in the following figure: