Class FlowHandlerAbstract<D extends FlowData>

java.lang.Object
org.bardframework.flow.FlowHandlerAbstract<D>
All Implemented Interfaces:
FlowHandler
Direct Known Subclasses:
FlowHandlerImpl

public abstract class FlowHandlerAbstract<D extends FlowData> extends Object implements FlowHandler
  • Field Details

  • Constructor Details

  • Method Details

    • start

      public org.bardframework.flow.FlowResponse start(Map<String,Object> initValues, Locale locale, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception
      Specified by:
      start in interface FlowHandler
      Throws:
      Exception
    • submit

      public org.bardframework.flow.FlowResponse submit(String flowToken, Map<String,Object> formData, Locale locale, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception
      Specified by:
      submit in interface FlowHandler
      Throws:
      Exception
    • action

      public Object action(String flowToken, String action, Map<String,Object> formData, Locale locale, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception
      Specified by:
      action in interface FlowHandler
      Throws:
      Exception
    • getCurrent

      public org.bardframework.flow.FlowResponse getCurrent(String flowToken, Locale locale, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception
      این متد فقط فرم جاری را برمیگرداند و پیش پردازش‌های آن را اجرا نمی کند
      Specified by:
      getCurrent in interface FlowHandler
      Throws:
      Exception
    • processAction

      protected boolean processAction(String flowToken, String action, D flowData, Map<String,Object> formData, FlowFormTemplate currentFormTemplate, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception
      Throws:
      Exception
    • fillFlowData

      protected void fillFlowData(Map<String,Object> flowData, Map<String,Object> formData, FlowFormTemplate currentFormTemplate, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse)
      افزودن دیتاهای مورد نیاز در فرم به فلو دیتا
    • processNextForm

      protected org.bardframework.flow.FlowResponse processNextForm(String flowToken, D flowData, Map<String,Object> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception
      1. محاسبه فرم بعدی
      2. اجرای پیش پردازش‌های فرم
      3. ذخیره داده‌های فلو
      Throws:
      Exception
    • getCurrentFormTemplate

      protected FlowFormTemplate getCurrentFormTemplate(D flowData) throws Exception
      Throws:
      Exception
    • onFinished

      protected void onFinished(String flowToken, D flowData, Map<String,Object> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception
      Throws:
      Exception
    • updateFlowData

      protected void updateFlowData(String flowToken, D flowData)
    • invalidateFlow

      protected void invalidateFlow(InvalidateFlowException ex)
    • toResponse

      protected org.bardframework.flow.FlowResponse toResponse(String flowToken, FlowFormTemplate formTemplate, D flowData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception
      تبدیل به فرم
      Throws:
      Exception
    • handleExceptionInternal

      protected org.bardframework.flow.FlowResponse handleExceptionInternal(String flowToken, D flowData, Map<String,Object> formData, FlowFormTemplate currentFormTemplate, FlowHandlerAbstract.FlowAction flowAction, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, Exception ex) throws Exception
      Throws:
      Exception
    • handleException

      protected abstract org.bardframework.flow.FlowResponse handleException(String flowToken, D flowData, Map<String,Object> formData, FlowFormTemplate currentFormTemplate, FlowHandlerAbstract.FlowAction flowAction, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse, Exception ex) throws Exception
      Throws:
      Exception
    • getStepsCounts

      protected int getStepsCounts(D flowData)
    • cleanFlowData

      protected void cleanFlowData(String flowToken)
    • process

      protected boolean process(List<FormProcessor> processors, String flowToken, D flowData, Map<String,Object> formData, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse) throws Exception
      Throws:
      Exception
    • onLocaleChange

      protected void onLocaleChange(String flowToken, D flowData, Map<String,Object> formData, FlowHandlerAbstract.FlowAction flowAction, Locale startLocale, Locale newLocale, jakarta.servlet.http.HttpServletRequest httpRequest, jakarta.servlet.http.HttpServletResponse httpResponse)
    • getPreProcessors

      public List<FormProcessor> getPreProcessors(D flowData)
    • getPostProcessors

      public List<FormProcessor> getPostProcessors(D flowData)
    • getActionProcessors

      public Map<String,List<FormProcessor>> getActionProcessors(D flowData)