You are on page 1of 19

An Oracle While Paper

February 2017

ADVANCED MODE IN JOURNAL APPROVAL RULES

or functionality. It is not a commitment to deliver any material. and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. and should not be relied upon in making purchasing decisions. release. It is intended for information purposes only. 2 . and may not be incorporated into any contract.Disclaimer Disclaimer The following is intended to outline our general product direction. The development. code.

8  Using Advanced Pattern ……………………………………………………………….…………………………………………………….10  Validate.………………………7  Define Condition ……………………………………………………………………………7  Adding Child Collection …………………………………………………………………..4  Advanced Mode pattern Matching options …………………………………………………………….15  What You Need to Know About Advanced Mode Rules …………………………………………. Save and Commit ……………………………………………………………11  Use cases ……………………………………………………………………………………………………………….. Table of Contents  What is Advanced mode …………………………………..……………………………………………………4  Why is it Required …………………………………………..19 3 .5  Steps to Configure Rules in Advanced Mode……………………………………………………………6  Select "Advance Mode" …………………………………………………………………6  Add Pattern ………………………………………………………….

4 . Why is it required? Advanced mode is used in cases where approvals should be routed based on aggregate or pattern of certain values in a journal batch. These cases are usually not possible or cumbersome to achieve with normal rule conditions. When approval is routed based on Journal line attribute. for large journals where there are lines of 500 or more. These include additional pattern matching options allowing user more control over the child collection of a transaction like Journal lines. each and every line would be processed which is performance hungry . each and every line is processed for a particular journal.What is Advanced mode Advanced settings for rules let user work with features that provide advanced options based on Business Rules users need. In such cases advanced mode is used to route them based on pattern and thereby reducing performance cost. resulting in delay in approval processing or sometimes lead to time out issues.

Average. As soon as it finds a line satisfying the condition a notification will be sent for approval. Maximum.  The rule will be evaluated until it finds a line satisfying the condition. If there is no line satisfying the condition. aggregation  Aggregation functionality is used when customer need to perform operations (like Sum. This is similar to normal mode. there is no case where  The value specifies that the rule fires once if there are no such matches. 5 . no notification will be sent. In this feature rule will be evaluated until it finds a line satisfying the condition. Count. where every line gets processed and the approval is routed. Minimum. Use cases related to Journals.Advanced Mode Pattern Matching Options There are four additional pattern matching options that are only available in advance mode: for each case where  This is the default pattern matching option. A notification will be send only if there is no line satisfying the condition.  Rule will be evaluated for all the lines and notification will be sent for all the lines satisfying the condition. Collection) on attributes of collection. A rule should fire each time there is a match (for all matching cases). generally does not require this pattern there is a case where  This option selects one firing of the rule if there is at least one match.

Steps to Configure Rules in Advanced Mode This section provides details on defining rules in advanced mode and also an example explaining how to convert rule in basic mode to advanced mode. Click "Show Advanced Settings" icon next to the rule name and then select "Advanced Mode" checkbox. Select "Advanced Mode" To show the advanced settings. 6 .

The following figure shows Journal Header collection with condition where Journal with currency as USD and total accounting debit is more than 5000. By default. rule designer sets the variable name equal to the fact type or path. Define Condition Use the variable defined in above pattern to create a condition on which rules have to be based on. 7 . The left side of a pattern is a variable and the right side is a fact type or a fact path. one "is a" pattern will be added to the rule as soon as "Advanced Mode" is selected.Add Pattern By default. Variable name is user specific an can be changed The following figure shows a variable "JH" of type "JournalHeader".

let’s see how to use various attributes of Journal lines in advance mode. For Ex. Lists is a mandatory pattern. Position] internally uses Lists collection. Approval Group. variable name can be edited to user desired value. Select the value in the Fact Type first (right side of "is a") from the drop down list and then the Variable name (left side of "is a") gets populated automatically. Define a collection "Lists". b) Add Lists pattern as below. Task. No need to define any conditions under this.creator etc.Adding Child Collection As Journals could have multiple Journal lines.payload. Task. It needs to be defined because in THEN part of the rule list builder [Supervisory. 2. 1. as we just need this to iterate patterns defined using collections or also to prepare the list builder. This list will be populated with the matching child collection based on the condition defined. Task is used whenever user wants to define approval rules based on human task payload or any other children of Task. JobLevel. a) Click on "Add Pattern" button to add other patterns. Resource. 8 .

Note: Since List builder is used in Then part . List is List collection is mandotory . in case if supervisory rule or any listbuilder that includes any children of Task as mentioned above. The following figure shows a pattern on Journal line with "Line" variable of Journal line type and then using Account type attribute of Journal line 9 . a corresponding pattern need to be defined. then Task is Task should aslo be used 3. Add pattern for Journal line to add conditions based on line attributes. As rules need to be defined on Journal line attributes.

Using Advanced Pattern As Journal could contain multiple Journal lines. the next step is to define a pattern matching option for the journal lines with account type as Expense. 10 . To do this. surround the journal line pattern with the advanced pattern matching option.

commit the rule 11 .Based on the business requirement. Save and Commit Validate and save. if there are no errors reported.  If ONLY one instance of Journal line == “E” (Expense) satisfies the requirement then select "there is a case where"  If there should be NO instance of Journal line == “E” then select "there is no case where"  If ALL Journal lines should belong to account type is “E” then select "for each case where"  Select "Aggregate" to use various aggregation operations Validate. different options can be selected.

12 .

The resulting rule in Advanced mode 13 .

if there is batch with multiple journals and each journal has few hundreds of lines.The same conditions when defined in Normal mode The advantage of defining the above rule in advanced mode is . Performance is higly improved using advanced mode resulting in approval flow without any errros. 14 . the performance would be highly impacted if all the journal lines for each journal have to be processed in normal mode and might lead to stack overflow or time out errors.

15 . If the journal batch has expnese journal lines then the approval should route to one approval group. and if it has no expense journal lines in the batch then it should route to another approval group. The below rule is defined to route the approvals to Approval group “AG1” in case there is a expense journal line in the journal batch.USE CASES Use case 1: User wants to route the approval of a journal batch based on accout type of journal lines .

Define another rule for the condition when there is no expense Journal lines in the batch to route to approval group “AG2” 16 .

a) if sum of debit journal lines with account type as Expense > 1000 Result = send to approval group “AG3” 17 .Use case 2: Use the aggregate function in advance mode to get the sum of Journal lines with account type as expense and define the rules based on the sum.

18 .

creator etc. "there is a case". The pattern variables are only shown for action lists when you use (for each) patterns. For Ex. is used then Task is Task also needs to be used along with Lists is Lists What You Need to Know About Advanced Mode Rules There are some special cases to keep in mind when you work with Advanced Mode rules. or "there is no case patterns". we want to sum all the Debit journal lines where account type is “E” JournalLine. o If you cannot simplify the rule. Task. deselect Advanced Mode. o If you can use Undo to undo the steps you used to create the Advanced Mode rule. Click the Show Advanced Settings icon next to the rule 3. Then simplify the rule and when Advanced Mode is enabled. To deselect Advanced Mode you must remove or undo the advanced mode features (sometimes it is easier to start over by creating a non-advanced mode rule and then delete the advanced mode rule). Consider the state of the rule: o If you can simplify the rule to enable the Advanced Mode option (such that the Advanced Mode icon changes from gray to enabled). as long as your rule uses advanced options such as advanced pattern matching.In the above use case.  After you select Advanced Mode the Advanced Mode stays selected and inactive (gray). To deselect the advanced mode option: 1. Select the rule or Decision Table where you want to deselect Advanced Mode. in actions. In the above use case if in the list builder human task payload or any other children of Task. then delete the rule and re-create it.accountedDr isn’t null is used in the conditions to make sure only the debit lines are summed Variable Total_dr aggregates the sum of all debit expense journal lines and then we use this value in the condition. Thus. including the following:  When you work with aggregates. to get to a state where the rule is no longer in Advanced Mode. 19 . then use this technique to simplify the rule. you do not see pattern variables. 2. Task.payload. you cannot see pattern variables in aggregate.