Tuesday, 30 October 2012

Oracle BPEL Variable Sensors for logging


Logging in Oracle BPEL at times becomes necessary even though we got a powerful and user-friendly Enterprise Manager(EM) console which acts as a debugging tool where you can trace and track BPEL process instances. Such as, in BPEL process instance flow that got executed you may have many sequential activities with multiple loop statements within, it will be difficult to determine what has happened in the execution of such instances from the long list of activities showing up on EM console.

Logging in BPEL can be realised using Oracle BPEL Variable Sensors. Sensors in BPEL are of three different types; variable sensors are used for logging which can be triggered when value in the process variable gets changed. In order to get this implemented, you need to create a process variable, define sensor variable from the process variable, and then define and map the action that needs to be done when the sensor is triggered.  Note that the variable sensor is triggered each time when the value contained in the variable gets changed. 


1. Create a Process variable


Define a process variable from Create Variable screen of BPEL , define the variable of string data type.




2. Define Sensor variable from Process variable

In monitor view of the BPEL component file in JDeveloper, click on the Monitoring Objects option to select the Sensors option.




Select the Variable Sensor option from the Sensors window. Name the sensor and chose the target as process variable created in step 1.



3. Define Sensor Action

Click on the Sensor Action option from the drop down menu of Monitoring Objects in the Monitor View of BPEL Component in JDeveloper.



Create a Sensor Action with Publish Type as Database.


4. Map the Sensor Action to Sensor Variable

Edit the Sensor Variable created in step 2 to map it to the sensor action of step 3 from the Edit Variable Sensor window of Sensor Variable.




Now that you have configured BPEL variable sensors, any change in the value of BPEL sensor variable will be shown in the Sensor Values  tab of the BPEL flow instance of EM console.



Thus, you can use variable sensors to populate with meaningful data at various places in the BPEL program to capture the process instance flow at run time.

Thursday, 11 October 2012

Minimum File Age Oracle SOA File/FTP Adapter Property

Oracle SOA File or the FTP adapter comes equipped with several properties during design time that can be used to meet the project requirements. Minimum File Age is one such property though may not be used all the time during the design of the File/FTP adapter components in the composite but when used, it does play a significant role in the way the files are picked from the File/FTP server.

Important points to be noted regarding the Minimum File Age Property:

  • Minimum Age is applicable only in case of a File/FTP poller operation (Read or the GET)
  • Minimum Age value is always specified in units of seconds in the File or the FTP JCA file of your composite though you may set the property using a different time unit in the File/FTP configuration wizard.
  • The property more commonly used to process large files that takes longer time by the application to write to the File/FTP server location from where the File/FTP adapter polls it.
  • When Minimum File Age property is set, the adapter takes into account the file modification time in order to pick the file.

Significance of Minimum File Age

Let me illustrate it with an example - Consider a use case, where you have multiple files with varying size written onto the FTP server location by some application. The large files may take more time to have them completely written on the FTP server path. During the time such large files are being written to the file location, the file modification time keeps changing.The FTP poller of the composite polling for a file on this file location with minimum file age unset(or set to zero) the poller may pick the file that's corrupt or invalid.   To avoid this, minimum age need to be set to an appropriate value in the FTP Adapter, that way only those files that are completely written are picked by the adapter for further processing.



The Minimum File Age value can be specified in the same screen of the File/FTP Adapter configuration wizard screen where you mention the polling frequency (as shown above)