Interface IPluginFormPreProcess

  • All Superinterfaces:
    IFCPlugin, IFormLifecyclePlugin, INamedUiElement, INameProviding, ITransferable, Serializable

    public interface IPluginFormPreProcess
    extends IFormLifecyclePlugin
    Interface for a form pre-process plugin. This plugin is executed when the form is submitted, after a FormEingang with the submitted form values was created and just before the workflow processing is about to start. Contrast this with a plugin of type IPluginFormPrePersist, which is run before a FormEingang is created; and to IPluginFormPreRespond, which is run after the workflow was processed.

    This plugin may prevent the workflow from being executed, in which case the a generic error page is returned to the user. You might use this plugin to have the submitted form data saved to the database, but prevent the workflow from being executed, or you could perform additional business logic.

    Author:
    XIMA MEDIA GmbH
    • Method Detail

      • execute

        IPluginFormPreProcessRetVal execute​(IPluginFormPreProcessParams params)
                                     throws FCPluginException
        The main method of this plugin. Performs any additional actions before workflow processing starts.

        When any exception other than FCPluginException is thrown, further workflow actions are not processed and a general error template is returned to the user who submitted the form.

        Parameters:
        params - The parameters this plugin may make use of. Gives you access, for example, to the current Vorgang, or the current Projekt.
        Returns:
        Whether the workflow processing should be run. If it is not run, a generic error page is returned to the user.
        Throws:
        FCPluginException - May be thrown when this plugin cannot perform is task due to any reason. Please note that throwing this exception will not prevent the workflow from being executed.
      • shouldExecute

        default boolean shouldExecute​(IFormLifecycleShouldExecuteParams params)
        Description copied from interface: IFormLifecyclePlugin
        Optional test to decide whether a form lifecycle plugin should be executed for a particular form request. Use e.g. params.getRequestContext().getRequestType() to check the type of the request.

        Note: Lifecycle plugins may be queued for execution at points were they were not before. Implementations of this method should prefer narrow checks, e.g.

         return params.getFormRequestContext().getRequestType() == EFormRequestType.PROVIDE}
         
        instead of
         return params.getFormRequestContext().getRequestType() != EFormRequestType.PROCESS
         
        Specified by:
        shouldExecute in interface IFormLifecyclePlugin
        Parameters:
        params - Parameters with the current form request.
        Returns:
        true if the plugin should be executed during the lifecycle of the given form request, false otherwise.