《Flowable 6.6.0 BPMN用户指南》
1. 入门
2. 配置
3 The Flowable API
4 Flowable 6.6.0 BPMN用户指南 - (4)Spring集成
5 Spring Boot
6 部署
7 BPMN 2.0简介
8 BPMN 2.0的构造
9 表单(Forms)
9.1 表单定义
9.2 表单属性
9.3 外部表单渲染(External form rendering)
有关Flowable的更多文档,参见:
《Flowable文档大全》
9 表单(Forms)
Flowable provides a convenient and flexible way to add forms for the manual steps of your business processes. We support two strategies to work with forms: Built-in form rendering with a form definition (created with the form designer) and external form rendering. For the external form rendering strategy form properties can be used (that was supported in the Explorer web application in version 5), or a form key definition that points to an external form reference that can be resolved with custom coding.
Flowable为向业务流程的手动步骤添加表单提供了一种方便、灵活的方式。我们支持两种处理表单的策略:带有表单定义的内置表单呈现(使用表单设计器创建)和外部表单呈现。对于外部表单呈现策略,可以使用表单属性(在版本5的Explorer web应用程序中支持),也可以使用表单键定义(form key definition),表单键指向可通过自定义编码解析的外部表单引用(external form reference)。
9.1 表单定义
Full information about the form definitions and Flowable form engine can be found in the Form Engine user guide. Form definitions can be created with the Flowable Form Designer that’s part of the Flowable Modeler web application, or created by hand with a JSON editor. The Form Engine user guide describes the structure of the form definition JSON in full length. The following form field types are supported:
有关表单定义和Flowable表单引擎的完整信息可以在表单引擎用户指南(Form Engine user guide)中找到。表单定义可以使用Flowable表单设计器(Flowable Form Designer)创建(Flowable Form Designer 是Flowable Modeler web应用程序的一部分),也可以使用JSON编辑器手工创建。表单引擎用户指南完整地描述了表单定义JSON的结构。支持以下表单字段类型:
Text: rendered as a text field
Multiline text: rendered as a text area field
Number: rendered as a text field, but only allows numeric values
Checkbox: rendered as a checkbox field
Date: rendered as a date field
Dropdown: rendered as a select field with the option values configured in the field definition
Radio buttons: rendered as a radio field with the option values configured in the field definition
People: rendered as a select field where a person from the Identity user table can be selected
Group of people: rendered as a select field where a group from the Identity group table can be selected
Upload: rendered as an upload field
Expression: rendered as a label and allows you to use JUEL expressions to use variables and/or other dynamic values in the label text
文本(Text):呈现为文本字段
多行文本(Multiline text):呈现为文本区域字段
数字(Number):呈现为文本字段,但仅允许数值
复选框(Checkbox):呈现为复选框字段
日期(Date):呈现为日期字段
下拉列表(Dropdown):显示为一个选择字段,其中在字段定义中配置了选项值
单选按钮(Radio buttons):呈现为一个单选字段,在字段定义中配置了选项值
人员(People):呈现为一个选择字段,可从Identity用户表中选择人员
人员组(Group of people):呈现为一个选择字段,可以从Identity组表中选择一个组
上载(Upload):呈现为上载字段
表达式(Expression):呈现为标签,在标签文本中,允许您使用JUEL表达式,并使用变量和/或其他动态值
The Flowable task application is able to render an html form from the form definition JSON. You can also use the Flowable API to get the form definition JSON yourself.
FormModel RuntimeService.getStartFormModel(String processDefinitionId, String processInstanceId)
or
FormModel TaskService.getTaskFormModel(String taskId)
The FormModel object is a Java object representation of the form definition JSON.
Flowable任务应用程序能够基于表单定义JSON渲染出一个html表单。您也可以使用Flowable API自己获取表单定义JSON。
FormModel RuntimeService.getStartFormModel(String processDefinitionId, String processInstanceId)
或
FormModel TaskService.getTaskFormModel(String taskId)
FormModel对象是表单定义JSON的Java对象表示。
To start a process instance with a start form definition you can use the following API call:
要通过启动表单定义启动流程实例,可以使用以下API调用:
ProcessInstance RuntimeService.startProcessInstanceWithForm(String processDefinitionId, String outcome,
Map variables, String processInstanceName)
When a form definition is defined on (one of) the start event(s) of a process definition, this method can be used to start a process instance with the values filled-in in the start form. The Flowable task application uses this method to start a process instance with a form as well. All form values need to be passed in the variables map and an optional form outcome string and process instance name can be provided.
当在流程定义的启动事件(其中之一)上定义表单定义时,可以使用此方法启动流程实例(包含启动表单中填写的值)。Flowable任务应用程序也使用此方法通过表单来启动流程实例。所有表单值都需要通过变量映射(variables map)传递,并且提供可选的表单结果字符串和流程实例名称。
In a similar way, a user task can be completed with a form using the following API call:
类似地,使用以下API调用,可以通过表单完成用户任务:
void TaskService.completeTaskWithForm(String taskId, String formDefinitionId,
String outcome, Map variables)
Again, for more information about form definitions have a look at the Form Engine user guide.
并且,有关表单定义的更多信息,请参阅表单引擎用户指南(Form Engine user guide.)。