Flowable 6.6.0 BPMN使用者指南 -9 表單 - 9.1 表單定義

月滿閒庭發表於2021-01-02

《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<String, Object> 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<String, Object> variables)

Again, for more information about form definitions have a look at the Form Engine user guide.

並且,有關表單定義的更多資訊,請參閱表單引擎使用者指南(Form Engine user guide.)。

相關文章