5.2. Process Forms
- ProcForm Interface
When you declare user task outcomes or the start event node in the model editor, it is possible to set a form that will be displayed to the user. The form class should implement the
The methods of the
getComment(): String- returns the value that will be written to the
commentfield of the
ProcTaskobject or to the
ProcInstanceif the form is displayed on a process start.
getFormResult(): Map<String, Object>- returns a list of objects that will be added to process variables after the form commit.
- A List of Forms for a Process Model Designer
A list of forms available in the process model designer is built according to the configuration files that are defined in the
bpm.formsConfigapplication property. To add a new process form, do the following:
Create and register a screen for the form. Screen controller must implement the
Create an XML file, e.g.
app-bpm-forms.xml, which will contain a description of custom forms, and place it under the
srcdirectory of the web or gui module. For example:
<?xml version="1.0" encoding="UTF-8"?> <forms xmlns="http://schemas.haulmont.com/cuba/bpm-forms.xsd"> <form name="myCustomForm" default="true"> <param name="someParam" value="hello"/> <param name="otherParam"/> </form> </forms>
myCustomFormhere is a screen id.
The above configuration also describes available form parameters with their names and default values.
A form with the
default="true"attribute will be used as the default form in the model.
bpm.formsConfigproperty in the
bpm.formsConfig = bpm-forms.xml app-bpm-forms.xml