Wiki source code of Statusverarbeitung
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{content/}} | ||
2 | |||
3 | == Interface IPluginProcessing == | ||
4 | |||
5 | {{figure image="plugin_processing.png"}} | ||
6 | Position of workflow processing plugins in {{formcycle/}}'s program flow. They are run as an action during workflow processing. | ||
7 | {{/figure}} | ||
8 | |||
9 | === Use cases === | ||
10 | |||
11 | * Sending the data of submitted forms to an web service | ||
12 | * Custom actions such as creating custom PDF files | ||
13 | |||
14 | === Method signature === | ||
15 | |||
16 | {{code language="java"}} | ||
17 | IPluginProcessingRetVal execute(IPluginProcessingParams params) throws FCPluginException | ||
18 | {{/code}} | ||
19 | |||
20 | == Parameters == | ||
21 | |||
22 | {{warning}} | ||
23 | For each paramter passed to the plugin, all [[variables will be replaced>>doc:Formcycle.UserInterface.Variables]]. For example, when a parameter contains the substring //[%tf1%]//, this substring will be replaced by the value of the forms field named //tf1//. Variable evaluation cannot be turned off currently. | ||
24 | {{/warning}} | ||
25 | |||
26 | An object of type {{jpath path="de.xima.fc.interfaces.plugin.param.workflow.IPluginProcessingParams"/}} is passed to the execute method, providing access to the following properties: | ||
27 | |||
28 | * The action for which this plugin has been selected. (//getAction()//) | ||
29 | * The parameters that have been set for this plugin. ((//getParams()//) | ||
30 | * The workflow processing context (//getWorkflowProcessingContext()//), granting access to: | ||
31 | ** The current form record (//getVorgang()//) | ||
32 | ** The form data (//getFormDataAdapter()//) | ||
33 | ** Session attributes (//getSessionAttributes()//) | ||
34 | ** A temporary directory for storing data (//getTempDirPath()//) | ||
35 | |||
36 | == Return value == | ||
37 | |||
38 | The execute method must return an object implementing {{jpath path="de.xima.fc.interfaces.plugin.retval.workflow.IPluginProcessingRetVal"/}}. | ||
39 | |||
40 | 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. | ||
41 | |||
42 | There are multiple interfaces extending {{jpath path="de.xima.fc.interfaces.plugin.retval.workflow.IPluginProcessingRetVal"/}} that can be used, the following list provides a quick overview | ||
43 | |||
44 | {{table dataTypeAlpha="0-1"}} | ||
45 | |= Interface|=Reference implementation|=Description | ||
46 | |IProcessingResultSuccess|ProcessingResultSuccess|For returning the success status as a simple boolean flag. | ||
47 | |IProcessingResultIntValue|ProcessingResultIntValue|In addition to the success status, allows for returning an integer return code as well. | ||
48 | |IProcessingResultStringValue|ProcessingResultStringValue|In addition to the success status, allows for returning a message as a string as well. | ||
49 | |IProcessingResultMultiValue|ProcessingResultMultiValue|In addition to the success status, allows for returning a map of strings as well | ||
50 | |IProcessingResultFilePath|ProcessingResultFilePath|In addition to the success status, allows for returning a path to a file as well. | ||
51 | |IProcessingResultFileData|ProcessingResultFileData|In addition to the success status, allows for returning binary data as well. | ||
52 | {{/table}} | ||
53 | |||
54 | An exception of type {{jpath path="de.xima.fc.plugin.exception.FCPluginException"/}} is thrown when any errors have occurred in the plugin. By [[setting up an appropriate error handler>>doc:Formcycle.UserInterface.MyForms.WorkflowProcessing.ErrorHandling]], the exception can be caught and actions can be taken accordingly. |