输入对话框表单
Input dialog form is a form defined in the BPMN process model. When users start processes or open user tasks, input dialogs are automatically rendered based on the configuration you provided in the model. Modifications of its layout and behavior aren’t available.
You can configure an input dialog for the StartEvent
of User Task
model elements.
To create an input dialog form, set form type Input dialog from the pull-down list in the BPMN Inspector panel.
Then additional form properties will appear:
Here you can choose open mode, set parameters, and outcomes.
Open Mode
This property defines a mode how the form will be open:
-
Dialog — means a modal window.
-
Navigate — view will be opened by navigating to its URL (specified in the
@Route
annotation)
By default, Dialog mode is used.
Parameters
Actually, parameters are form fields that may show data to the user or expect input from him. You can create parameters from the BPMN Inspector panel:
Next, the parameter editor window will open. Here you can select the process variable from the pull-down list or define a new variable by entering its name.
The parameter may be editable and required according to checkboxes.
支持的参数类型:
-
String(字符串)
-
Multiline string(多行字符串)
-
Decimal(小数)
-
Number(整数)
-
Boolean(布尔值)
-
Date(日期)
-
Date with time(日期时间)
-
Entity(实体)
-
Entity list(实体列表)
-
File(文件)
-
Platform enum(平台枚举)
-
Custom enum(自定义枚举)
For types Entity
and Entity list
additional properties are available. Here you have to define an entity class from the pull-down list:
Then, select a UI component that will be used for the entity. There are two options: ComboBox or EntityPicker
By default, the EntityPicker option is selected. In this case, you can choose a Lookup screen as well. If you leave it empty, the standard list view for this entity will be used.
When a Combo box is selected, you have to specify a JPQL query, with 'where' and order by
clauses if needed.
You can write the query manually or use JPQL Wizard.
After parameters are created, you can edit them directly in the BPMN Inspector panel.
After the first parameter is created, a dialog window with a list of parameters appears. You can continue creating parameters here and manage its order.
XML Representation
As was said above, the input dialog form is defined directly in the BPMN model.
So it is represented in the XML by jmix:formData
attribute:
<jmix:formData type="input-dialog" openMode="DIALOG">
<jmix:formFields>
<jmix:formField id="order" caption="Order" type="entity" editable="true" required="false">
<jmix:formFieldProperty name="entityName" value="smpl_Order" />
<jmix:formFieldProperty name="uiComponent" value="comboBox" />
<jmix:formFieldProperty name="query" value="select e from smpl_Order e where e.amount > 1000" />
</jmix:formField>
<jmix:formField id="name" caption="Name" type="string" editable="true" required="false" />
</jmix:formFields>
Business Key
When creating an input dialog form for the start event, you can define a business key.
It is possible to set a value of business key directly or take it from the process variable.
Outcomes
Outcomes are pre-defined variants of the user task completion, indicating what decision the performer has made.
For example, in a document approval task, the user can approve a document or reject it. Respectively, there should be created two outcomes: “approve” and “reject”.
On the process forms, outcomes represented by named buttons. To complete the task, a user must press one of them.
Whatever outcome button the user chooses, task complete event will be fired, but the standard Complete button wouldn’t be shown if outcomes are defined.
You can create outcomes from the BPMN Inspector panel:
Then, the outcomes editor window will open. Here you can create outcomes and provide them with icons.
As well, you can edit outcomes directly in the BPMN Inspector panel.
XML Representation
Outcomes in the XML are defined in jmix:formOutcomes
section.
<jmix:formOutcomes>
<jmix:formOutcome id="approve" caption="Approve" icon="CHECK" />
<jmix:formOutcome id="reject" caption="Reject" icon="BAN" />
</jmix:formOutcomes>
Example
Finally, the input dialog form will look like that:
When using entities as form parameters, better use Jmix view forms. |