protected void addStageActions(@Nonnull final SessionData data, Element command) {
        // Add allowed actions to the response
        Element actions = command.addElement("actions");
        List<Action> validActions = getActions(data);
        for (AdHocCommand.Action action : validActions) {
            actions.addElement(action.name());
        }
        Action executeAction = getExecuteAction(data);
        // Add default execute action to the response
        actions.addAttribute("execute", executeAction.name());

        // Store the allowed actions that the user can follow from this stage
        data.setAllowedActions(validActions);
        // Store the default execute action to follow if the user does not specify an
        // action in his command
        data.setExecuteAction(executeAction);
    }
Adds the allowed actions to follow from the current stage. Possible actions are:
{@code prev}, {@code next} and {@code complete}.

@param data metadata and the gathered data through the command stages.
@param command the command element to be sent to the command requester.
xmppserver/src/main/java/org/jivesoftware/openfire/commands/AdHocCommand.java