Workflow plugin
Interface IPluginProcessing
Use cases
- Sending the data of submitted forms to an web service
- Custom actions such as creating custom PDF files
Method signature
IPluginProcessingRetVal execute(IPluginProcessingParams params) throws FCPluginException
Parameters
An object of type IPluginProcessingParams is passed to the execute method, providing access to the following properties:
- The action for which this plugin has been selected. (getAction())
- The parameters that have been set for this plugin. ((getParams())
- 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 IPluginProcessingRetVal.
This interface allows you to return either a simple boolean flag as the result, indicating whether the plugin has been successful, or multiple values as string or binary data.
There are multiple interfaces extending IPluginProcessingRetVal that can be used, the following list provides a quick overview
Interface | Reference implementation | Description |
---|---|---|
IProcessingResultSuccess | ProcessingResultSuccess | For returning the success status as a simple boolean flag. |
IProcessingResultIntValue | ProcessingResultIntValue | In addition to the success status, allows for returning an integer return code as well. |
IProcessingResultStringValue | ProcessingResultStringValue | In addition to the success status, allows for returning a message as a string as well. |
IProcessingResultMultiValue | ProcessingResultMultiValue | In addition to the success status, allows for returning a map of strings as well |
IProcessingResultFilePath | ProcessingResultFilePath | In addition to the success status, allows for returning a path to a file as well. |
IProcessingResultFileData | ProcessingResultFileData | In addition to the success status, allows for returning binary data as well. |
An exception of type FCPluginException is thrown when any errors have occurred in the plugin. By setting up an appropriate error handler, the exception can be caught and actions can be taken accordingly.