Placeholder substitution (system)


Schnittstelle IPluginSystemReplacer

Position of system variable evaluation plugins in Xima® Formcycle's program flow. They are run before system variables are processed by Xima® Formcycle.

Use cases

This type of plugin allows you to define new system variables or modify how existing variables are being evaluated. These plugins will be run before variables are processed by Xima® Formcycle.

For example, this allows you to change the URLs of certain system variables and to redirect them to other URLs.

System variables use the following syntax:

[%$variableName>%]

When multiple system variable evaluation plugins are installed, their order of execution is arbitrary. You should not rely on a certain fixed order.

System variable evaluation 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 signature

IPluginSystemReplacerRetVal replace(IPluginSystemReplacerParams params) throws FCPluginException

Parameters

An object of type IPluginSystemReplacerParams is passed to the execute method, providing access to the following properties:

  • The entire variable string, including its syntax, eg. [%$ATTACHMENT_LIST%]. (getPlaceholder())
  • The variable name, without its syntax, eg. ATTACHMENT_LIST. (getPlaceholderContent())
  • The workflow processing context (getWorkflowProcessingContext()), granting access to:
    • The current form record (getVorgang())
    • The form data (getFormDataAdapter())
    • Session attributes (getSessionAttributes())
    • A temporary directory for storing data (getTempDirPath())

Return value

The execute method must return an object implementing IPluginSystemReplacerRetVal.

The class PluginGenericReplacerRetVal provides a reference implementation. Its constructor takes the string containing the evaluated value of the variable.