About the SCA Nodes sample extension

The savings account assembly diagram is modified to include an extra import binding, CurrentAccountRequest, that is used to make a call to the broker message flow that is hosting the current account.

Savings Account Extend Assembly Diagram

The business process is also amended to reflect this current account and initiates a transfer only if sufficient funds are available.

Business Process Diagram for Extended Assembly

The key differences between this extended application and the simple one are:

The current account

The current account is hosted on WebSphere Message Broker as a message flow that comprises the two subflows and the following nodes:

Current Account Message Flow

The SCAInput node in the message flow receives the message that contains the operation to be performed, for example, debit or credit, and the amount to transfer. Depending on whether the amount is to be credited or debited, the message is propagated, by using the appropriate dynamic terminal, to either the CurrentAccountDebit or CurrentAccountCredit subflow.

Both subflows contain JavaCompute nodes:

  1. One JavaCompute node reads the current account balance from the file system and propagates this value by using the local environment.
  2. One JavaCompute node performs the calculations to determine whether the transfer can proceed. The values of the operation, current account balance, and transfer amount are used in the calculations. The values for the operation and current account balance are retrieved from the local environment and the transfer amount is retrieved from the message.
  3. One JavaCompute node updates the new current account balance to the file system.

If the incoming message request is an instruction to debit the current account, the transfer amount is subtracted from the current account balance. If the result is less than zero, the previous balance is propagated by using the local environment and a response message is created, which states that the transaction is not authorized. If the result is greater than or equal to zero, the new balance is propagated by using the local environment and a response message is created that authorizes the transaction.

Message flow for debitting current account

If the incoming message request is an instruction to credit the current account, the transfer amount is added to the current account balance. The new balance is propagated by using the local environment and a response message is created that authorizes the transaction.

Message flow for creditting current account

The response message is sent back to the caller, WebSphere Process Server, at the SCA Reply node.

Back to sample home