Developer Guide to BPEL Designer
Testing a deployed business process application involves using test cases that act as remote partner services which send SOAP messages to the BPEL Service Engine runtime.
The BPEL Service Engine runtime receives the SOAP message and creates an instance of the BPEL process and starts executing the instance. A BPEL process can have many running instances. The BPEL Service Engine runtime receives a message and, using correlation, routes it to the appropriate instance of the process. If an instance does not exist yet, a new instance is created.
To test-run a deployed business process application, you need to configure test cases to act as remote partner services sending SOAP messages to the BPEL Service Engine runtime.
In order to obtain test results you must do the following:
All steps in this section assume the following:
To add a test case and bind it to a BPEL operation:
If you viewed the test case in the Files tab, you would see Concurrent.properties as a third file.
To set the test properties:
To customize test input:
To run a single test case:
Debugging BPEL processes follows the same general principles as debugging Java applications. Debugging BPEL processes is accomplished by setting breakpoints in the source code or on the diagram and executing the process step-by-step within a debugging session.
The main steps in debugging BPEL processes are:
A debugging session starts when you attach the BPEL Debugger to the BPEL Service Engine. Only one debugging session can be running on the BPEL Service Engine.
After a debugging session starts, you can execute process instances step-by-step, inspecting process instance variables and/or values of the XPath expressions.
To prepare the debugging environment:
To start a debugging session on the BPEL Engine:
The IDE now establishes a debug session on the BPEL Engine. Watch the BPEL Debugger Console window for confirmation. The connection can take some time to complete. When it is completed successfully, you see the new session in the Sessions window and the following message in the BPEL Debugger Console:
22:17:55 Connecting to localhost:3343 22:17:55 Debug session started
If you have several debugging sessions (you may have a Java debugging session running at the same time) and want to change the current session, double-click the name of this session in the Sessions window. Alternatively, right-click the session you want to make current and select Make current.
This session becomes current and the BPEL Process Instances, Watches and BPEL Variables windows are updated to show the data related to the new current session.
When you want to finish a debugging session, open the pop-up menu for the session you want to stop and choose Finish in the Sessions window or select Finish Debugger Session on the toolbar. A message that the debugging session is finished is displayed in the BPEL Debugger Console.
To finish all debugging sessions, in the Sessions window, right-click any session and choose Finish All.
When a debugging session starts, the IDE displays debugger windows
below the IDE editing area. The Sessions, BPEL Process Instances,
Watches and BPEL Variables windows contain information related to BPEL
processes running within the current debugging section.
Note: If a debugger window is not displayed, choose Window > Debugging > BPEL > window-name (for example, Window > Debugging > BPEL > BPEL Variables).
The Call Stack, Breakpoints and Watches are standard IDE debugger windows. The Call Stack window is not used in debugging BPEL processes, so you can ignore it. The Breakpoints window reflects all breakpoints currently set in the IDE, including breakpoints in BPEL processes. The Watches window lists all expressions that you have specified to watch while debugging.
To switch between debugger windows, click the tab with the window name.
The Sessions window lists all debugging sessions, including Java and BPEL debugging sessions, that are currently running in the IDE. Only one session can be started for the BPEL Engine and only one session can be current (this session is shown in bold). Other debugger windows, such as BPEL Process Instances, Watches and BPEL Variables, display process instances, expressions and variables related only to the current debugging session.
The information provided for each session includes:
You can perform the following actions on sessions available in the pop-up menu:
The BPEL Process Instances window lists all BPEL process instances running on the BPEL Engine within the current debugging session. If the current session is not a BPEL Debugger session, this window is empty. The BPEL Process Instances window is populated when a debugging session is started on the BPEL Engine or a BPEL Debugger session becomes current.
The information displayed for each process instance includes the instance name and its state. Process instances can be in one of the the following states:
The BPEL Variables window shows the list of BPEL variables and their values for the current process instance and current position. The current position is a place at which the current process instance became suspended. When you change the current process instance, the records in the BPEL Variables window are updated to reflect the variables for the new current process instance and the new current position.
The information provided for each variable includes the variable name and value.
The Watches window shows a list of XPath expressions that you want to monitor. You add watches explicitly before or during the debugging session. The Watches window shows the expression and its value. The value of the expression may change as the process advances depending on the logic of your process.
Breakpoints are used to instruct the debugger to suspend execution of a process at that place of the source code. When a BPEL process reaches a breakpoint, it becomes suspended and you can perform debugging operations, such as examining the values of variables or stepping into your code.
To view and organize all breakpoints currently set in the IDE, open the Breakpoints window by choosing Windows > Debugging > BPEL > Breakpoints (Alt-Shift-5). For each breakpoint, you can see the name of the source file and the line where this breakpoint is located.
After you set breakpoints in your BPEL Process and start a debugging session, any process instance that reaches a breakpoint becomes suspended. You can view the status of process instances in the BPEL Process Instances window.
To debug a process instance that has reached a breakpoint:
Once the execution of a process instance is suspended, choose the following commands from the Run menu or on the toolbar:
You can remove a breakpoint from the BPEL source code by placing the cursor at the line with the breakpoint and choosing Run > Toggle Breakpoint, or clicking the left margin of the line that contains the breakpoint. Alternatively, on the diagram, you can right-click the element that has a breakpoint and choose Toggle Breakpoint from the pop-up menu.