|Skip Navigation Links|
|Exit Print View|
|Oracle Java CAPS BPEL Designer and Service Engine User's Guide Java CAPS Documentation|
The Oracle Java CAPS BPEL Service Engine provides you with the ability to trace the message or expression values during the process execution. The Logging and Alerting feature make use of standard WS-BPEL extension mechanism. Logging and alerting are supported for almost all BPEL activities.
The NetBeans IDE provides the ability to define logging and alerting for the process activities.
Logging is used to write specified expression values or partner links endpoint reference information to the server log.
Alerting allows you to receive an alert with this information.
After you set the logging or alerting conditions and the BPEL process is executed, specified expression values are written to the server log file or an alert is sent to the user, depending on the log level.
Both logging and alerting are defined in the Logging mapper. The Logging mapper is available from the Design or Source view menu bar.
When defining logging for an activity you can trace the value of the following components :
In the mappings you can use one or more XPath functions from the menu bar.
LOG_onStart. The variable value is written to the log when the activity starts.
LOG_onComplete. The variable value is written to the log when the activity execution is complete.
To make a search of the value recorded to the log file, you can concatenate the value with the string literal as shown on the figure below.
In the Design view a small icon appears to the lower-right of the activity when it has logging defined. By clicking the icon you can switch to the Logging mapper.
The entry to the log is only made if the log level defined for the variable corresponds to the log level specified for the BPEL Service Engine on the application server.
The log level for the BPEL Service Engine is specified in the GlassFish Admin Console. To set the log level for the BPEL Service Engine:
Right click GlassFish V2 application server node, and choose Properties from the context menu. The Servers window opens. On the Servers pane, GlassFish V2 should be selected.
On the Connection tab, copy the contents of the Location field (by default it is localhost:4848).
Paste the string to the browser and press Enter. The GlassFish Admin Console opens in the browser window.
If logging is defined for a process activity, and the log level specified for it corresponds to the log level set for the BPEL SE, after you perform a test run of the process, the selected variable value will be written to the server log file.
Note - The project should be deployed to the application server.
Date and time of the entry
Manager type (for logging this is Trace Manager)
The message value
Here is the sample of the log entry :
[#|2008-03-25T09:26:18.796+0300|INFO|sun-appserver9.1|com.sun.jbi.engine.bpel.core.bpel.trace.BPELTraceManager|_ThreadID=26;_ThreadName=BPELSEInOutThread8;|<?xml version="1.0" encoding="UTF-8"?><jbi:message xmlns:msgns="http://localhost/SynchronousSample/SynchronousSample" name="input1" type="msgns:requestMessage" version="1.0" xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper"><jbi:part><syn:typeA xmlns:syn="http://xml.netbeans.org/schema/SynchronousSample"> <syn:paramA>Hello World</syn:paramA> </syn:typeA></jbi:part></jbi:message>|#]
Alerting feature enables you to get notification in case specified events happen. Alerting events are connected with the execution of the process activities.
As a general rule-of-thumb, whenever you log you may also want to consider sending an alert notification of the appropriate severity as you see fit. Fatal, Critical, and Major Alert Notification Severities map well to a SEVERE logging category. The Minor and Warning Alert Notification Severities map well to a WARNING logging category. The Info Alert Notification Severity maps well to an INFO logging category.
The general workflow for defining alerting is as follows:
Set the alert level for your activity. This is done from the Logging Mapper, similar to the way you define Logging. Map the variable in the Output pane for which you want an alert, to the appropriate Alert activity and alert level, for example, ALERT_onComplete - major.
The Alert notification levels are:
Ensure the application server is running and deploy the project.
From the Admin Console, choose or create MBean client and subscribe to getting event notifications. The client will extract alerting messages and perform specified actions (write to log/send e-mail/do nothing).
Run the process and get notified.