Tuesday, August 9, 2022

OIC - Create a header file based on sequential unique lines Transaction number | Oracle Integration cloud

Usecase: Here, the requirement is, we will have a source file which contains sequential duplicate transaction based lines or records. Based on sequential unique transaction numbers we have to fetch unique lines and write header file.

For instance,

Source file:

Transaction_Identifier,Transaction_number,Event_Type_Code,Ledger_Name,Date

Line,10,Payment,XX,08/09/2022

Line,10,Payment,XX,08/09/2022

Line,11,Reverse,XX,08/09/2022

Line,12,Payment,XX,08/09/2022

Line,12,Payment,XX,08/09/2022

Line,13,Payment,XX,08/09/2022

Line,13,Payment,XX,08/09/2022

Line,14,Payment,XX,08/09/2022

Expected output header file:

Transaction_number,Event_Type_Code,Ledger_Name,Date

10,Payment,XX,08/09/2022

11,Reverse,XX,08/09/2022

12,Reverse,XX,08/09/2022

13,Payment,XX,08/09/2022

14,Payment,XX,08/09/2022


Logic steps:

  • Using FTP adapter connection, download the file to stage location and then read the file reference using sample csv filw format.
  • Assign preTransactionNumber as empty string("").
  • Write the header field names
  • For each ledger line or record,
    • Assign the current transaction number to variable transactionNumber
    • Take a switch and put condition as preTransactionNumber != transactionNumber
      • If its true, write the ledger record to header file to that stage location
      • Otherwise, skip the duplicate line
    • Assign the preTransactionNumber = transactionNumber
  • After the loop, read the entire header file from the stage location
  • Write the file to a FTP location.

Steps with screenshots:

Download the file



Created 2 schedule parameters to feed the file name and file directory.



Read the file reference 




Assign preTransactionNumner as "".


Write the header field names.






For each ledger record


Assign the transaction number


Take a switch and check if preTransactionNumber != transactionNumber
If the condition true, then add the transaction header line in the stage location. Otherwise skip the line.



Write the transaction header.





Assign the preTransactionNumber with last Transaction number



After the loop, read the entire header file and write to FTP location.









Integration flow:


Testing:

Source file:


Output:



Thursday, August 4, 2022

Create a Decision model based on expressions | Process Cloud Service

Usecase: Here, we will create a decision model based on expressions and will expose as a REST service. 

Implementation Steps:

Oracle cloud Home >> Processes >> Decision models


This will land on graphical view.


Switch to list view 


Add input data



Add new decision 


Take Expressions


Add the expression.



Play app


Test




Creating a little complex expression with 2 input fields



Test



Expose as service




Activate


Similarly we can create decision models based on If Then else, Functions, Contexts, Lists, Relations, Loops and Decision tables.

Follow oracle docs to create with above ways:

https://docs.oracle.com/en/cloud/paas/integration-cloud/user-processes/model-decision-logic1.html


How to configure Hit Policy | Decision table | Process Cloud Service

  • The Hit Policy Indicator cell displays the hit policy selected for the table. 
  • The hit policy determines the output of a decision table from the output cells of matched rules. A rule is matched when all of its condition cells match the inputs of the decision table.

Based on the hit policy, Decision Model Notation (DMN) broadly groups decision tables into the following categories:
  1. Single Hit: A single-hit table returns the output of only one rule. Under the single-hit category, Process supports the following hit policies:

    • Unique (U) – Only one of the rules can match.

    • Any (A) – Multiple rules can match, but all matching rules must have the same output.

    • First (F) – Multiple rules can match; the output of the first rule that matches is returned.

    • Priority (P) – Multiple rules can match; the output value that has the highest priority is returned.

  2. Multiple Hit: A multiple-hit table returns the output of multiple rules. Under this category, the following hit policies are supported in Process:

    • Collect (C) – Multiple rules can match; outputs are returned as an arbitrarily-ordered list.

    • Collect Sum (C+) – Multiple rules can match; the sum of outputs is returned.

    • Collect Min (C<) – Multiple rules can match; the smallest output value is returned.

    • Collect Max (C>) – Multiple rules can match; the largest output value is returned.

    • Collect Count (C#) – Multiple rules can match; the count is returned.

When you create a new table, the Unique (U) hit policy is selected by default. 

To change the policy, click the Hit Policy Indicator cell and choose from the available options in the Hit Policy drop-down list. If rules within the table violate the selected hit policy, a warning is displayed within the decision.


Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...