protected function processActionFormCreate(Request $request, ActionMapping $mapping) {
        $formClass = $mapping->getFormClassName();
        if (!$formClass)
            return null;

        /** @var ActionForm $form */
        $form = null;

        // if the form has "session" scope try to find an existing form in the session
        if ($mapping->isSessionScope())
            $form = $request->getSession()->getAttribute($formClass);       // implicitely starts a session

        // if none was found create a new instance
        /** @var ActionForm $form */
        if (!$form) $form = new $formClass($request);

        // if a DispatchAction is used read the action key
        $actionClass = $mapping->getActionClassName();
        if (is_subclass_of($actionClass, DispatchAction::class))
            $form->initActionKey($request);

        // populate the form
        $form->populate($request);

        // store the ActionForm in the request
        $request->setAttribute(ACTION_FORM_KEY, $form);

        // if the form has "session" scope also store it in the session
        if ($mapping->isSessionScope())
            $request->getSession()->setAttribute($formClass, $form);

        return $form;
    }