Friday, 2 May 2014

Dynamic Outbound Directory Name and Filename in File Adapters

For outbound operation in File adapter Oracle SOA 11g provides the feature to change outbound directory name and file name dynamically.
In order to achieve this we need to configure jca.file.Directory and jca.file.FileName property in Invoke activity.

For clarity consider the below example.

  • For your BPEL process configure the File Adapter for outbound operation and while file configuration provide some dummy values for File name and Outbound File Directory. 


  • Create two variables MyDir and MyFileName of string datatype.


  • Before your invoke activity create an Assign activity and assign the respective values for directory name and file name which you want to use at runtime.


  •  Double click Invoke activity to edit, in properties tab assign the variables (MyDir and My FileName) for the jca,file.Directory and jca.file.FileName respectively.


  • Deploy the project and test it, file name and directory name will be overridden dynamically at run-time.
  • Directory name and filename configured at design time was /temporary and sample.txt. But at runtime it got replaced with the values assign at runtime i.e. /u01/temp and test.txt





Let us know your valuable feedback for the post. Happy coding.. :)

Tuesday, 15 April 2014

Oracle BPEL Variable Sensors For Monitoring

Sensors are the monitoring artifacts which can be used to monitor variable values, activity execution facts and fault details. For example using an Activity Sensor we can evaluate a scope activity start execution time, finish time and what is the value of a variable in that scope after execution completes.

There are the following type of sensors are there.

  • Variable Sensor : Used to detect value of a variable through out the bpel life cycle. We can use it for logging purpose in a BPEL process.
  • Activity Sensor : Used to monitor an activity within the BPEL process and also the variable used within the activity.
  • Fault Sensor : Used to monitor different BPEL faults during execution.
With every sensor we need to configure corresponding sensor actions like after triggered the sensor what Action it needs to perform. We can use one of the following type of Sensor Action with the sensor.
  • Database : publish the sensor data into report schema of in the database.
  • JMS Queue : publish the sensor data to a JMS queue
  • JMS Topic : publish the sensor data to a JMS Topic
  • Custom : publish the sensor data to a custom java class
  • JMS adapter : publish the data to a remote JMS queue or topic
When we use a sensor in BPEL process the Jdeveloper generates two files in it.
  • bpel_process_name_sensor.xml : It contains the sensor details.
  • bpel_process_name_sensorAction.xml : It contains the corresponding sensor Action details.
The following example describes the creation of a variable sensor and monitor its values from Report schema of the database.
  • In the BPEL process create a simple string type variable as LogMessage.
  • Assign the input value and different values to the above created variable.





















  • Go to the Monitor tab of the BPEL process in the SOA editor of Jdeveloper.





  • Go to the Structure pane of the Jdev and select variable under Sensors and click on add button.



















  • Give the sensor name to any name. Choose the sensor variable as LogMessage variable. Then give the sensor Action as Database and save all.





















  • After creating the sensor it generated two xml files in the project.

















  • Deploy the project and test the same from the Oracle Enterprise Manager.








  • Goto the launch Flow trace from EM then click on Sensor Values tab. Click on the LogMessageVarSensor and you will find the corresponding values in the Sensor Values tab.

















Please give your comment on the above post.
Happy Coding :)