Wiki source code of Statusverarbeitung
Hide last authors
author | version | line-number | content |
---|---|---|---|
1.1 | 1 | {{content/}} | |
2 | |||
1.12 | 3 | == Interface IPluginProcessing == | |
1.1 | 4 | ||
1.12 | 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. | ||
1.1 | 7 | {{/figure}} | |
8 | |||
1.12 | 9 | === Use cases === | |
1.1 | 10 | ||
1.12 | 11 | * Sending the data of submitted forms to an web service | |
12 | * Custom actions such as creating custom PDF files | ||
1.1 | 13 | ||
1.12 | 14 | === Method signature === | |
1.1 | 15 | ||
1.12 | 16 | {{code language="java"}} | |
17 | IPluginProcessingRetVal execute(IPluginProcessingParams params) throws FCPluginException | ||
18 | {{/code}} | ||
1.1 | 19 | ||
1.12 | 20 | == Parameters == | |
1.9 | 21 | ||
1.1 | 22 | {{warning}} | |
1.12 | 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. | |
1.1 | 24 | {{/warning}} | |
25 | |||
1.12 | 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: | |
1.1 | 27 | ||
1.12 | 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()//) | ||
1.1 | 35 | ||
1.12 | 36 | == Return value == | |
1.1 | 37 | ||
1.12 | 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 | |||
1.1 | 44 | {{table dataTypeAlpha="0-1"}} | |
1.12 | 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. | ||
1.1 | 52 | {{/table}} | |
1.12 | 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. |