Pre-render


Interface IPluginFormPreRender

Position of pre-render plugins in Xima® Formcycle's program flow. They are run before the form is rendered and sent to the user's browser. Xima® Formcycle

Use cases

  • Providing the form with data from external data sources or web services
  • Prefilling form fields
  • Preventing forms from being sent to the user

When multiple pre-render plugins are installed, their order of execution is arbitrary. You should not rely on a certain fixed order.

Pre-render plugins are run for all forms of the client they belong to, or for all existing forms when installed as a system plugin. We recommend you check whether the plugin should be executed for the current form, for example by defining a plugin property containing a list of allowed forms.

Method signatures

IPluginFormPreRenderRetVal execute(IPluginFormPreRenderParams params) throws FCPluginException

Transfer values: The IPluginFormPreRenderParams type provides the following properties:
  • Access to the form request context (IFormRequestContext) and thus to central objects such as:
    • process
    • project
    • form version
    • session parameters
    • current user context in order to be able to perform database operations, for example
    • client
Return values: The return value must be of type IPluginFormPreRenderRetVal, a reference implementation is provided by the class PluginFormPreRenderRetVal.The object enables the transfer of a serialisable JSON object, which is available after delivery of the form to the browser, under the plugin name, in the form variable XFC_METADATA.Furthermore, setting the value map can cause fields to be pre-filled when the form is rendered. These values overwrite existing values if necessary and also replace values from URL parameters.If the plug-in is not processed correctly, an FCPluginException is thrown.