BPEL
fi Fibonacci function
Fibonacci function BPEL4WS process
Example
The Fibonacci function calculates number based on following algorithm:
int fi (int i)
{
if (i < 2)
return i;
return fi (i-1) + fi (i-2)
}
The example contains code for a simple Fibonacci function service. It accepts an integer number as an input and calculates the Fibonacci number. The process like the Fibonacci function does a recursive syncronous invocation of itself.
The example is allowed with values less than 6. If is entered value greater then 6, will be printed the message "Entry values greater then 6 are not allowed!" and the input entry value will be initialized to 6.
To build and run the example follow the steps bellow:
- Login into the BPEL UI via http://host:port/BPELGUI.
- From the 'Home' tab page go to section 'Tasks' and click 'Upload Process' link. Another way is to choose 'Processes' tab and go to the 'Process Upload' sub-tab.
- For the given entry form in the "Process name" field type 'Fi' in order the process to be invoked successfully.
- In the "Load Deployment Descriptor URI" field type 'http://host:port/BPELDemo/fi/bpel.xml'.
- Choose the 'Import Process' button.
- Choose the 'Compile process' button.
- If compilation succeeds, will go to the 'Processes' page where the process will be in the given processes list.
- To test the process click "Test" in the listing. This goes to a page allowing you to enter a start message for creating a new instance of this process.
| View the source | Action |
|---|---|
| 1. bpel.xml | |
| 2. fi.bpel | |
| 3. fi_wsdl.vsp | Run |
| 4. service.vsp | Run |
OpenLink Home
Technical Support