Interface IPluginFormPrePersist
-
- All Superinterfaces:
IFCPlugin
,IFormLifecyclePlugin
,INamedUiElement
,INameProviding
,ITransferable
,Serializable
public interface IPluginFormPrePersist extends IFormLifecyclePlugin
Interface for form pre-persist plugins. This plugin is executed when a form was submitted, but before aFormEingang
is created and the form data is saved to the database. Contrast this with a plugin of typeIPluginFormPreProcess
, which is run after aFormEingang
was created; and toIPluginFormPreRespond
, which is run after the workflow was processed as well.This plugin offers the option to add an custom check whether the form submission should be prevented or not. When this plugin prevents the form submission, the submitted form data is discarded and no form record is created. The workflow is then not run either.
- Author:
- XIMA MEDIA GmbH
-
-
Field Summary
-
Fields inherited from interface de.xima.fc.plugin.interfaces.IFCPlugin
CONFIG_FILENAME
-
Fields inherited from interface de.xima.fc.interfaces.INamedUiElement
ATTR_DISPLAY_NAME
-
Fields inherited from interface de.xima.fc.entities.interfaces.INameProviding
ATTR_NAME, COL_NAME
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description IPluginFormPrePersistRetVal
execute(IPluginFormPrePersistParams params)
The main method of this plugin.default boolean
shouldExecute(IFormLifecycleShouldExecuteParams params)
Optional test to decide whether a form lifecycle plugin should be executed for a particular form request.-
Methods inherited from interface de.xima.fc.plugin.interfaces.IFCPlugin
getDescription, getDescription, getDisplayName, getName, initialize, initPlugin, install, shutdown, shutdown, uninstall
-
-
-
-
Method Detail
-
execute
IPluginFormPrePersistRetVal execute(IPluginFormPrePersistParams params) throws FCPluginException
The main method of this plugin. Checks and returns whether the form submission is acceptable.When any exception other than
FCPluginException
is thrown, the form will not be persisted and a general error template is returned to the user who submitted the form.- Parameters:
params
- The parameters this plugin may make use of. Contains the current form request context that may be used to access the submitted form data.- Returns:
- Whether the form submission should be allowed or prevented.
- Throws:
FCPluginException
- May be thrown when this plugin cannot perform its task due to any reason. If this exception is thrown, the form will still be persisted.
-
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 ofreturn params.getFormRequestContext().getRequestType() != EFormRequestType.PROCESS
- Specified by:
shouldExecute
in interfaceIFormLifecyclePlugin
- 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.
-
-