Extending the AbstractDynamicMenu Class

Many SMS and Unstructured Supplementary Service Data (USSD) applications rely on menus to receive consumer responses. Menus reduce the potential for response errors, because they are numbered lists.

The AbstractDynamicMenu class simplifies the development of custom-menu states that extend the class, because they inherit:
Custom states that extend the AbstractDynamicMenu class must implement these methods:

Message recipients can select from lists, and reply using index numbers. If a menu has more than four items, it includes a pagination option, which displays the next four items in the list. On the last page, selecting the pagination option returns to the first page. Selecting the exit option abandons a list without a response; the application task flow determines the follow-up transition. To force recipients to choose an item from the list, you can disable the exit option.

In a typical custom-state implementation that extends the SmappStatePlugin class, you implement state logic in the processStateLogic method. However, when you extend the AbstractDynamicMenu class, both processStateLogic and processMessageLogic methods are implemented by the abstract class. These methods contain the menu processing logic, and are declared as final, so they cannot be overridden.

Related concepts
List Variables
Related reference
Sample Custom-Menu State