Buttons and processes
- What is a process?
- Associating a process with a button
- Customizing existing processes
- What next?
- See also
This feature is available with Orbeon Forms 4.2 and newer.
This documentation describes how to configure the behavior of the buttons that appear at the bottom of the Form Runner detail page, whether in
view mode. Here is an example of such buttons:
What is a process?
A "process" consists in a list of actions, or steps, which are executed by Form Runner, typically when the user presses a button. For example, a process might say: "when the user presses this button, validate the form data, then save it to the database".
With Orbeon Forms, processes are configurable. They are defined separately from buttons, but can be linked to buttons. Orbeon Forms comes with predefined processes for some common tasks, such as saving form data, but you can write your own processes.
Associating a process with a button
A process is automatically associated with a button by name when using the following properties:
<property as="xs:string" name="oxf.fr.detail.buttons.orbeon.controls"> summary clear pdf save-final wizard-prev wizard-next review </property>
Here the following buttons get associated with processes of the same name defined in separate properties:
clear button is not implemented as processes but handled directly by Form Runner. This is also the case of the
tiff buttons, until Orbeon Forms 2016.3. [SINCE Orbeon Forms 2017.1] The
tiff buttons are implemented using the
Customizing existing processes
So how do you customize processes? Say you want to specify a couple of buttons on your "acme/hr" form. Like above, you define a property:
<property as="xs:string" name="oxf.fr.detail.buttons.acme.hr"> save-draft send </property>
This places a
send button on the page. Their default labels are "Save" and "Send". Each button is automatically associated with processes of the same names,
send. These particular button and process names are standard, but we can customize them specifically for our form. Again, this is done with a property:
<property as="xs:string" name="oxf.fr.detail.process.send.acme.hr"> require-valid then email then send("http://example.org/") then navigate("/success") recover navigate("/failure") </property>
With this, we have overridden the functionality of the "Send" button specifically for the "acme/hr" form.
Button labels can be overridden as well:
<property as="xs:string" name="oxf.fr.resource.*.*.en.buttons.send" value="Fancy Send"/>
With this, we have overridden the label of the "Send" button in general for all forms which are displayed in the english local.
Another approach would be to create an entirely custom button instead of reusing the name
send. Just pick a button/process name, say
foo, and then:
footo the list of buttons for the form
- define a button label for
- define a process for
NOTE: With Orbeon Forms 4.5.x and earlier, the property must be
oxf.fr.resource.*.*.en.detail.buttons.send. With Orbeon Forms 4.6 and newer, the
detail token can and should be omitted.
You can learn more about:
- the process syntax
- the actions you can use, including:
- predefined buttons, processes and dialogs