Invoking Session bean from the BPEL process
Session beans are defined by the Java Enterprise Edition specification. They are divided into stateless and stateful beans. A stateless session bean operates on the operation level. This means that after the operation is executed, the state of the session bean is not preserved. On the contrary, stateful beans preserve state across a multi-operation level.
This recipe will explain how to call a session bean operation from the Java Embedding activity from the BPEL process.
Getting ready
To complete the recipe, we will create a project in JDeveloper and a session bean that will act as exchange money operation on ATM. The session bean will calculate how much money the customer will get, based on the amount of money inserted into ATM, exchange rate of the currency, and deduced fee.
We start by creating a generic project in JDeveloper and naming it
ExchangeATM
. Right-click on the project node and select the New… option. Select the Session Bean (EJB) option...