saveSessionVariables(String, String) method

This method is called after a selection is made from the menu, allowing the subclass to prepare the OutputAttributes (if needed) before transition to the follow-up state.

protected abstract SmappState saveSessionVariables (
    String key,
    String value
) throws DBException


  • key Selected menu item key
  • value Selected menu item value


null - correspond to everything is OK, proceed as normal SmappState - other than OK, and it needs to be handle accordingly.


  • DBException Exception when accessing or saving the session variable from database


When the returned value is null, it will be treated as continueOk(). Otherwise, it will be used as the follow-up transition.

In addition, this method is also called in the special cases when the menu contains a single item only. Instead of displaying the menu, the state will immediately transition to the single-item follow-up state. This single-item follow-up state is whatever SmappState returned by the continueWhenSingleEntry(SmappState) method. By default, it is continueDyn(1). See continueWhenSingleEntry(SmappState) for details. The SmappState returned by this method will be submitted to the continueWhenSingleEntry(SmappState) method.

It's possible to make additional service called within this method to gather additional information based on the selected item. For example, if the menu presents the transaction list, a call to get transaction details based on the selected transaction item can be done.