8.11 Application Rule

This Application Rule is used to execute any queries in the Process Flow.

Function Application Rule

Function as the Application Rule Type from the drop-down list. Function represents a predefined function for application logic.

Table 8-4 Function Application Rule Details Description

Field Name Description
Name Enter a unique name for the Function Application Rule.
Rule Type Select the Rule Type from the drop-down list. The Function 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 Function.
Implementation Detail
  • Decision Rule- For Decision Rule the Function Statement should return ‘PASS’ for success condition.

    For example, select ‘PASS’ from dual where {EXPENSES} <= {THRESHOLD}

    Note: {EXPENSES}, {THRESHOLD} are user defined Data Fields.

  • Execution Rule- For Execution Rule the Statement can be any DML statement.

    For example, update fct_expenses set expenses={EXPENSES} where id = {WF_ENTITYID}

  • Selection Rule- For Selection Rule the Statement should be a Select statement that returns a list of values.

    For example, select v_created_by from fct_expenses id = {WF_ENTITYID}

Return Parameter

Select the Data Field that receives the return parameter of the Rule, from the drop-down list.

  • For Execution Rule type, the business logic is implemented in the method and the parameter value returned from the Function Rule is saved in the mapped Data Field.
  • In the case of Selection Rule type, the Java method should be a String value.
  • In the case of the Decision Rule type, the Java method 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.

Expression Application Rule

Used to define custom expressions for business rules or calculations. This is same as the SQL execution type. You need to specify only where clause in the Expression field. It can be any SQL expressions including ‘AND’/ ‘OR’.

Table 8-5 Expressions

Name Description
Name Enter a unique name for the Application Rule.
Rule Type Select the Rule Type from the drop-down list. The Expression 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 Expression.
Expression Type Select Expression Type as SQL to use SQL expressions or JSON to use JSON expressions.
Expression Enter the expression in SQL format or JSON format.
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 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.

Attribute Expressions

The Attribute Expressions is used to configure expressions based on specific attributes or data fields.

Table 8-6 Attribute Expressions

Field Name Description
Name Enter a unique name for the Application Rule.
Rule Type Displays the rule type as DecisionRule. This Rule Execution type supports only DecisionRule type.
Execution Type Displays the Application Execution Type as Attribute Expression.
Attribute Select the attribute for which you want to define the application rule, from the drop-down list. The list displays the attributes configured for the selected application and component.

Click Add to add values to the selected attributes. A row is added in the Attribute Values pane. Click the Value column to select the values for the attribute from the drop-down. You can select one or more values.

You can delete a row by clicking Delete icon.

You can select multiple attributes and click Add to assign values to those attributes.

Advanced Attribute Expressions

This is an advanced version of Attribute Expression Application Rule with additional logical conditions and assignment operators. The expression can be dynamically built and will return True or False value after evaluation. This is used as a DecisionRule in transitions. You can define this application rule with multiple conditions and nested groups.

Table 8-7 For Advanced Attribute Expression Application Rule

Field Name Description
Rule Name Enter a unique name for the Application Rule.
AND/ OR Select the logical operator to be used for the conditions in a group.
Add Condition

When you click Add Condition, a new row gets added. To define a condition, select the attribute, the operator and the value from the drop-down lists. Multiple values can be selected for each attribute.

Attribute- The drop-down list displays the attributes configured for the selected application and component.

Operator- Available options are in,=,<>,<,<=,>,>=.

· Value- Displays the values configured for the selected attributes. Select the required value.

Click Remove Condition to delete an already added condition.

Add Group Click Add Group if you want to have nested conditions. For each group, select the required logical operator as AND or OR.

Click Remove Group to delete a group of conditions.

JSON Write to DB

This Application rule is used to extract data from the JSON Path Expression, which gets returned from a Rest API or Web Service call, and you can store it into a Data Field for further processing.

Table 8-8 For JSON Path Expression Application Rule

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

Select the rule type from the drop-down list. The available rule types are Decision Rule and Execution Rule.

For Decision Rule, the output of JSON Path Expression will be compared with RHS expression and rule will return either true or false accordingly.

For execution rule, JSON Path Expression is evaluated and the output is returned to the DataField selected as Output DataField.

Execution Type Displays the Application Execution Type as JSON Path Expression.
JSON Input Select the Data Field in which the output of Web Service is stored from the drop-down list. You should select a DataField which has JSON as its value.
JSON Path Expression Enter the JSON path expression.
Operator This field is displayed only if Rule Type is selected as Decision Rule.

Select the required operator for comparison from the drop-down list. The options are =,<,>,>= and <=.

RHS Expression This field is displayed only if Rule Type is selected as Decision Rule.

Enter the expression to which you want to compare the JSON path expression.

Output DataField This field is displayed only if Rule Type is selected as Execution Rule.

Select the DataField to which you want to return the value of JSON Path Expression, from the drop-down list.

Scope Select the scope of the Application Rule from the drop-down list. The options are:
  • Process- Select Process if you want to use the Application Rule only in the current process.
  • Package- Select Package if you want to use the Application Rule across all the processes in the Application package.
Convert To Type Select JSON ARRAY to store the output in Array format or select String to store as a string, from the drop-down list.

JSON Read from DB

This Application Rule is used to read data from the database in JSON format.

Table 8-9 JSON Read from DB

Field Name Description
Name Enter a unique name for the Application Rule.
Rule Type Only the Execution Rule type is supported.
Execution Type Displays the Execution Type as JSON Read From DB.
Table Name Enter the table name from which you want to read the data.
Column List Enter the column names of the selected table.
Where Condition Enter the filter condition (where clause) of the SQL query.
Return JSON Type Select the JSON type of the returned value as JSON Object or JSON Array based on your requirement.

JSON Object- Select this option if the returned value is a single row.

JSON Array- Select this option if the returned data has multiple rows.

Output DataField Select the DataField to which you want to return the value of the SQL query, from the drop-down list.
Scope
Select the scope of the Application Rule from the drop-down list. The options are:
  • Process- Select Process if you want to use the Application Rule only in the current process.
  • Package- Select Package if you want to use the Application Rule across all the processes in the Application package.