Saturday, 22 June 2019

How to Capture EBS Business Event in Oracle Integration Cloud

In this article, we are going to describe how to capture Events in Oracle Integration Cloud of Enterprise Business Suite (EBS) using the Oracle EBS adapter.

For example, if an Account Payable (AP) transaction closes for the period the AP raises the event “oracle.apps.ap.CloseProcess.period”. The status of the closed transaction can be sent to the downstream application once it is captured in the Oracle Integration Cloud.

During design time, we need to create an integration called "Close AP Transaction" with Oracle E-Business Suite “Financials” as a trigger (source) connected through the Oracle E-Business Suite Adapter

During run time, if an Account Payable transaction closes, the business event “oracle.apps.ap.CloseProcess.period” is raised in Oracle EBS Account Payable which triggers the Integration.

Pre-requisite to achieve the use case:
Refer section “Deploy the required REST services in Oracle E-Business Suite” to deploy the above required service of a document
  • We must perform the one-time setup tasks in Oracle E-Business Suite to enable the business event. Refer section “Setup Tasks for Using the Oracle E-Business Suite Adapter as a Trigger (Source) Connection” of the document
  • Enable event oracle.apps.ap.CloseProcess.period in Oracle EBS suite. This article will help you to enable events.
  • EBS Adapter connection in Oracle Integration, refer blog to create
Enable event oracle.apps.ap.CloseProcess.period in Oracle EBS suite
  • Login into EBS-suite and go to the Application Administrator -> Workflow -> Administrator Workflow -> Business Events
  • Expand “Show More Search Options” from Event tab, search “%Payables%” from Display Name and click on the Go button
  • Below screenshot shows all the events along with the status. See the column “Status” to check if the corresponding event is enabled or disabled
  • As of now the all the events are enabled but to enable/disable  use Edit icon in Update column
Subscribe event “oracle.apps.ap.CloseProcess.period” in Oracle Integration Cloud
  • Login into Oracle Integration Cloud and create an “Orchestration Integration” with the name “CloseAPTransaction
  • Drop EBS adapter as a Trigger point and enter the name as a “SubsribeCloseAPEvent” and select “Business Event” radio button from What do you want to configure the endpoint for
  • Select Below information and click on the Next button
    • Product Family: Select Financials
    • Product: Payables
    • Business Event: Once selected Product Family and Product, all enabled Event will be listed. Select the one which you are interested in. We want to capture the “Oracle Payables: Close Process”. Hence select the same and click the Next button
  • Select Done button to finish the Wizard
  • Enable tracking and select “Event Name” as a primary field

Let’s save and Activate the Integration

Once the event is subscribed, the Integration Cloud subscriber must be visible in the EBS. To check if the subscriber has been added follow below steps
  • Go back to the EBS and click on the “Subscribe” icon corresponding to the “oracle.apps.ap.CloseProcess.period” event
  • Notice the Subscriber list should increase. Previously the total subscriber was 4, now it is 5
  • Click on the edit icon and click the Next button from the first page
  • Notice WFBES_REST_RESOURCE_PATH, WFBES_REST_RESOURCE_BASE variable in which Integration cloud Endpoint would be visible
Test the Event
  • Go back to the EBS and click on “Select To Test the Event” icon corresponding to the “oracle.apps.ap.CloseProcess.period” event
  • Enter the information as below and click on the Raise in Java button
    • Event Key: 1234
    • Add two parameter (FirstName, LastName) from “Event Parameters” section
  • Once Event is raised successfully, a Success message will appear
  • Open Integration Cloud Monitoring and see one Event should reach “CloseAPTransaction” Integration

·

Friday, 14 June 2019

Securing files using PGP encryption (Part-2-Decryption): Oracle Integration

This is the second part of transferring the secured file over SFTP in Oracle Integration Cloud. In the previous blog, we showcased how to create encrypted files using Pretty Good Privacy (PGP) mechanism.

In the article, we'll process the encrypted file, decrypt it and print the records into the logs.

I'll recommend you to check the previous article before going ahead.

To decrypt the file, we would be needing the PGP private key along with the password.

The PGP key private key needs to be uploaded into the FTP connection. Open the FTP connection and click on the Configure Security button. Notice the "PGP Private Key" field, click on the Checkbox and click on the Upload button.

Once we click on the Upload button, it will allow us browsing the file. Browser the PGP private key and click on the Upload button

Enter the PGP private key password


Once done, click on the Test connection button. If everything is OK, the connection should be tested successfully.

Let's try to decrypt the PGP encrypted file.
  • Create a scheduler process with the name "DecryptFiles"
To decrypt the file, we have to download the file into Oracle Integration Cloud staging area and decrypt it
  • Drop the FTP connection on Integration canvas, enter the endpoint name as "DecryptFile" and click on the Next button
  • Enter the below information and click on the Next button
    • Select Operation: Download File
    • Select a Transfer Mode: ASCII
    • Input Directory: Enter the directory(/home/opc/target) where the encrypted file resides
    • File Name: Enter the file name to be read(Encrypt.csv)
    • Check the Decrypt the File option
  • Finish the FTP wizard
  • File has been decrypted at Stage location of Integration Cloud. So to read the file from Staging we have to use Stage activity. Drop the Stage File activity just below the FTP adapter
  • Enter the endpoint name as "ReadFile"
  • Enter the below information and click on the Next button
    • Choose Stage File Operation: Read Entire File
    • Specify the File Name: Select Expression builder and drop fileName element of $DecryptFile object
    • Specify the directory to read from: Select Expression builder and drop directory element of $DecryptFile object
  • Select Create a new schema from a CSV file radio button
  • Enter the below information and finish the Wizard
    • Select the Delimited Data File: Choose the sample CSV file with below structure
    • Enter the Record Name: Enter as "Employee"
    • Enter the Recordset Name: Enter as "Employees"
    • Use First Row as a Column Header: This will be enabled only once the sample CSV file is browsed. This allows us to treat the First row as a header row or data row. If this is checked, which means the first row will be treated as a header(will not be picked up during reading) else data row. Uncheck this option as during encrypting the file we have not added header
FirstName,LastName,Qualification
Ankur,Jain,MCA
Tom,ghai,BED


We completed the configuration. Let's save, activate and Submit the Integration now.

Open the Activity Stream of the instance and see the decrypted data should be shown of the Stage Read File Operation


The data can be looped over and do the processing as required.

Securing files using PGP encryption (Part-1-Encryption): Oracle Integration

Are you scared the data can be hijacked during transmission of the files if we are doing transactions using the Integration Cloud? Do not scare, read the article and feel comfortable to transmit the files in a secured manner.

Oracle Integration Cloud provides Pretty Good Privacy (PGP) mechanism to encrypt or decrypt the files which allow us to read/write files in a secure manner.

So, we only required PGP public and private keys to transfer files in a secure manner.
  1. Do you want to encrypt the file?: So use PGP public key to encrypt
  2. Do you want to decrypt the file? Use PGP private key to decrypt
We are dividing encryption and decryption into two parts:

Part 1): Will demonstrate how to  encrypt the files
Part 2): Will demonstrate how to decrypt the files

In this article, we'll cover Part-1 

Use Case: We'll read the plain CSV from FTP location and create the encrypted CSV file on FTP location

Let's see how to achieve this.

Before we encrypt the file, we have to upload the PGP public key into the Integration FTP connection. So, I am considering we already have one FTP connection in place. Open the FTP connection and click on the Configure Security button. Notice the PGP Public Key field, click on the Checkbox and click on the Upload button.

Once we click on the Upload button, it will allow browsing the file. Browse the Public key file and Click the Upload button


See the ASCII-Armor Encryption field. Select Yes or No depending on the encryption requirement. For the time being, we are taking as No. Also, select the Cipher Algorithm based on the requirement

Once done, click on the Test connection. The connection should be tested successfully.
  • Now create a Scheduled based integration and drop the FTP adapter
  • Enter the endpoint name as "ReadFile"
  • Enter below information and click the Next button
    • Select Operation: Select Read a File
    • Select a Transfer Mode: ASCII
    • Input Directory: Enter the directory(/home/opc/source) from where the file needs to be read
    • File Name: Enter the file name(Test.csv) to be read
  • Select Yes from Do you want to specify the structure for contents of the file and Select the Sample delimited document(e.g. CSV) from the drop down
  • Specify below information and complete the FTP wizard
    • Select the sample CSV file with below structure
    • Enter the record name as "Employee"
    • Enter the recordset name as "Employees"
FirstName,LastName,Qualification
Ankur,Jain,MCA
Tom,ghai,BED

Leave another option as it is for the time being

  • Drop FTP connection again and enter the endpoint name as "WriteEncryptFile"
  • Enter below information and click the Next button
    • Select Operation: Select Write File
    • Select a Transfer Mode: ASCII
    • OutputDirectory: Enter the directory(/home/opc/target) where the file to be written
    • File Name Pattern: Enter the file name(Encrypt.csv) to be created
    • Select Yes for Enable PGP Security option
    • Select Encrypt for PGP Security Mode option
  • Select Yes from Do you want to specify the structure for contents of the file and Select the Sample delimited document(e.g. CSV) option
  • Specify below information and complete the FTP wizard
    • Select the sample CSV with the same structure as above
    • Enter the record name as "EncryptEmployee"
    • Enter the recordset name as "EncryptEmployees"
  • Open the WriteEncryptFile mapper and do the mapping as below
Source Element
Target Element
$ReadFile -> Employees
WriteFile ->EncryptEmployee
$ReadFile -> FirstName
WriteFile ->FirstName
$ReadFile -> LastName
WriteFile ->LastName
$ReadFile -> Qualification
WriteFile ->Qualification

The configuration is completed now. Let's test the integration. Keep the plain CSV file on FTP with the same structure as we defined during reading and writing the file.

Submit the integration and open the FTP target directory. An encrypted file should be created there. Open the file and see the file should be encrypted.

In the Next blog, we will read the same encrypted file, decrypt it and print the content into logs.

Monday, 10 June 2019

Enable notification in 5 minutes: Oracle Process Cloud Service

Would you like to notify the user to take action (approve/reject) or just simply notify that some action has happened in middle of the process? Here is the article which helps you to enable the notifications in Oracle Process Cloud Service.

This article will not take more than 5 minutes to complete. Oracle PCS provides the Notify activity which allows us to send email notifications.

I'm extending my previous blog to enable the notification. So please check the article before you proceed further.

In the PCS, first, we have the turn on the from address. Please see the blog to see how to configure from address so that email can be sent.

Let's see how to configure the Notify activity.
  • Open the LeaveProcess and drop the Notify activity from the System Pallete between User Task and End activity
  • Select the Notify activity and click on the Open Properties
  • Select the Expression parallel to the "To" field. Here we can add hardcoded or dynamic recipient. We'll take "To" from the Leave Form.  Select the Simple from the Expression Mode and enter below expression
leaveFormDataObject.email

  • Select the Expression parallel to the "Subject" field. Here we'll hardcode the subject as "Your leave has been approved"
  • Select the Expression parallel to the "Body" field and enter below dynamic expression
"Your leave has been approved from "+leaveFormDataObject.from+" to"+leaveFormDataObject.to
  • We can configure Cc, Bcc, Reply also. For the time being leave as it is
  • Now save the process. Before we test the Integration, we have to Publish the Process. Publish the process and Test. 
  • Open the Leave Process form and enter information as below:
  • An email should come to the entered Email Address in the form

A Simple application from Scratch: Oracle Process Cloud

Are you a beginner in Oracle Process Cloud Service and want to learn how to play with this and create processes, forms, etc. So here is the article for you to learn step by step. This guide will only take 30 minutes to complete.

In this article, we will create a simple Leave Requisition process in Oracle Process Cloud Service(PCS) which can help to understand the basics of PCS.

To begin with, you would be needing access to Oracle Process Cloud Service and Sign in Credentials. If you don't have it right now, create a free 30 days free trial from here

Let's go ahead and create the process
  • Login into the Oracle Process Cloud Service and Click on the Create button
  • Click on the Create an Application tile
  • Enter  information as below and Click on the Create
    • Name: Enter name of the application of your choice(LeaveRequisitionApp)
    • Space: Select the existing Space or Click on New Space(if required)
    • New Space: Enter the space name as "HumanResource"
    • Description: Enter description optionally
    • Open Immediately: Check the checkbox
  • Select the Start with a form pattern
  • Once selected, a Create Process popup will come up which will allow you to enter the Process name(LeaveProcess) and the pattern will be selected automatically which we selected in the previous step. Click on the Create button
  • The process will be opened with the default start and end activity. In the LeaveProcess tab, double-click the gray vertical bar on the left, enter Employee in the role field, and press Enter
  • Below the Employee swimlane, click on Create New Lane to add a new lane
  • In new Swimlane double-click the gray vertical bar on the left, enter Manager in the role field, and press Enter and drop the End activity in Manager Swimlane
  • Expand Human in the Elements Palette, and drag and drop the Approve task to the Manager swimlane in the process flow diagram
  • Select the arrow between the start and end activity and drop on the User Task. Select the User Task, pick the Add Sequence Flow and drag the sequence flow onto the end activity. Once done, the process flow will look like below

Let’s add a web form to the business process with leave request details.
  • In the LeaveProcess tab, click Start, click Menu, and select Open Properties
  • Enter Title as "Leave Requisition Form", click + button corresponding to the Form field. 
  • On the opened popup, enter the form name as "LeaveForm", select Open Immediately checkbox and click on the Create button
  • In the Web Form Designer, drag and drop the Email control from the Basic Palette to the form’s canvas
  • Select the control and see how the tabs in the Properties pane change to General and Styling. The General tab is selected by default. Click Name and enter "Email", and then click the Label and enter "Email Address"
  • Drag and drop the following controls from the Elements Palette onto the canvas and configure them as follows: 
Control Name
Name
Label
Date
From
From
Date
To
To
TextArea
Reason
Reason


 Select the Save button and Close the form
  • Open the LeaveProcess tab, click User task, click Menu, and then click Open Properties
  • In the General tab, Click Browse to search from the Form field and select the form (LeaveForm)
  • Select Expression Editor corresponding the Title Field
  • In the Expression Mode enter below expression:
"Leave Request From "+LeaveForm.from

  • Enter the below expression in the Task Summary field:
"Hi, The Leave Travel Request has been raised between " + LeaveForm.from + " to " + LeaveForm.to + " for the reason " + LeaveForm.reason


  • Click the Save button
The Process has been completed now. It's time to test the process. Before we test the process, we have to publish the Process.
  • Click on the Publish button, enter below information and click on the Publish button
    • Select Make snapshot checkbox
    • Enter the snapshot name as Process Completed
    • Enter the comment
  • Click on the Test button, then click Activate. From the opened popup select the "Add Me to All Roles" checkbox and click on the Activate button
  • Once Activated, the Play button will be active now. Click on the Play button
  • From the Application Player tab, click on the "LeaveProcess" process
  • Notice the Play icon on Start activity. Click on the Play icon
  • Click on the Run button. This will open the form
  • Enter the information and click on the Submit button

  • The Application Player runs the business process. As it passes through each flow element and sequence flow, it outlines the path(in red) it takes through the process. It stops when the process instance reaches a flow element that requires input
  • Click on the Play icon of the User Task and Click on the Launch Form
  • Notice the Values submitted by the Employee in the Previous form. Simply close the form now

  • Again, click on the Play icon of the User Task and Click the Approve button
  • Red path showing the process has been completed now