表单创建
接口 `http://localhost:8080/flowable-ui/modeler-app/rest/models`
方法 org.flowable.ui.modeler.rest.app.ModelsResource#createModel
主要涉及表 ACT_DE_MODEL
POST http://localhost:8080/flowable-ui/modeler-app/rest/models
{"name":"FORM_FIRST_NAME","key":"FORM_FIRST_KEY","description":"FORM_FIRST_DESCRIPTION","modelType":2}
查重
==> Preparing: select * from ACT_DE_MODEL WHERE model_type = ? and model_key = ? and tenant_id = ?
==> Parameters: 2(Integer), FORM_FIRST_KEY(String), (String)
<== Total: 0
创建 json
String json = modelService.createModelJson(modelRepresentation);
插入 model
==> Preparing: insert into ACT_DE_MODEL ( id, name, model_key, description, model_comment, created, created_by, last_updated, last_updated_by, version, model_editor_json, model_type, thumbnail, tenant_id) values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
==> Parameters: 8bac7140-7b9d-11ee-8672-2c0da7505766(String), FORM_FIRST_NAME(String), FORM_FIRST_KEY(String), FORM_FIRST_DESCRIPTION(String), null, 2023-11-05 13:36:04.795(Timestamp), admin(String), 2023-11-05 13:36:12.429(Timestamp), admin(String), 1(Integer), {"version":0}(String), 2(Integer), null, (String)
<== Updates: 1
表单保存
接口 /flowable-ui/modeler-app/rest/form-models/8bac7140-7b9d-11ee-8672-2c0da7505766
方法 org.flowable.ui.modeler.rest.app.FormResource#saveForm
涉及表
`ACT_DE_MODEL
`
ACT_DE_MODEL_HISTORY
保存模型
PUT http://127.0.0.1:8080/flowable-ui/modeler-app/rest/form-models/8bac7140-7b9d-11ee-8672-2c0da7505766 HTTP/1.1
{"reusable":false,"newVersion":true,"comment":"save","formRepresentation":{"id":"8bac7140-7b9d-11ee-8672-2c0da7505766","name":"FORM_FIRST_NAME","key":"FORM_FIRST_KEY","description":"FORM_FIRST_DESCRIPTION","version":1,"lastUpdatedBy":"admin","lastUpdated":1699162572429,"formDefinition":{"name":"FORM_FIRST_NAME","key":"FORM_FIRST_KEY","fields":[{"type":"text","name":"Name","required":true,"readOnly":false,"id":"name","overrideId":true,"placeholder":"sfq"},{"type":"text","name":"Age","required":true,"readOnly":true,"id":"age","overrideId":true,"placeholder":"18"}],"outcomes":[]}},"formImageBase64":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAABsCAYAAADQUo+tAAAAAXNSR0IArs4c6QAABtJJREFUeF7t3c+LTW8cB/DPSMpvxkwTChtEKGXDBktN2RElexslCysLWdvMxh9AWdjKz6zJ0sKP7NiRn6GUjM4puuXHc2fOc+997j2vW/pafOY5n+f1Od93mGfOGfv27dts+BAgQGAIBMYE1hBMSYsECNQCAsuNQIDA0AgIrKEZlUYJEBBY7gECBIZGQGANzag0SoCAwHIPECAwNALJwJqdnY3qlw8BAgT6IbBgwYJ/XiYZWG/evInJycl+9OkaBAgQiO/fv8fChQv/KiGw3CAECBQlILCKGodmCBD4n0CjwPrw4UOsWrWKMAECBPoi0CiwPn36FCtWrKgbvXTpUhw9ejSuXLkSp0+fjmfPnsXU1FT932XLlsXevXvj0aNHsXXr1rhz505s3749duzY0ZdNuggBAqMhkDWwqjB6/PhxnDx5MmZmZmJ6ejr2799f/0PZgwcP4u7duzE+Ph5nzpwZDT27IECgrwJZA+vs2bNx7ty52Lx5c33cYcuWLb8D6+HDh3H//v04duxY/acsHwIECMxVIFtgzfXC6gkQIDBXAYE1VzH1BAgMTCBbYH38+DH+dwp1YDsc8IWZDHgAQ3b5Hz9+DFnHvW+3+ube+vXr6wtlC6zqf8x/nUDt/ZZcgQCBURV49epVfeJAYI3qhO2LwAgJvH37NpYvXy6wRmimtkJgZAUE1siO1sYIjJ5AzwPr4sWLcf78+Xj+/HlMTEzE6tWr69+vXLky1q1bN3qidkSAQM8E+hJYBw4ciKtXr8aFCxfi8uXLUR0qrf4eOjY21rONWZgAgdET6EtgVSfeq8DasGFDbNu2LdasWRPVafcqyHwIECDQrUC2wOp8gJ9jDd3yqyNAYC4C2Y41dAbW58+f59JDa2r9Fbg1o86yUY8c/ztj9cSX6tPo4KhHJGe5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Qh8ECCQFBFaSSAEBAqUICKxSJqEPAgSSAgIrSaSAAIFSBARWKZPQBwECSQGBlSRSQIBAKQICq5RJ6IMAgaSAwEoSKSBAoBQBgVXKJPRBgEBSQGAliRQQIFCKgMAqZRL6IEAgKSCwkkQKCBAoRUBglTIJfRAgkBQQWEkiBQQIlCIgsEqZhD4IEEgKCKwkkQICBEoREFilTEIfBAgkBQRWkkgBAQKlCAisUiahDwIEkgICK0mkgACBUgQEVimT0AcBAkkBgZUkUkCAQCkCAquUSeiDAIGkgMBKEikgQKAUgZ95BYFSpa4C7gAAAABJRU5ErkJggg=="}
==> Preparing: insert into ACT_DE_MODEL_HISTORY ( id, name, model_key, description, model_comment, created, created_by, last_updated, last_updated_by, version, model_editor_json, model_type, model_id, removal_date, tenant_id) values ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )
==> Parameters: dac9f931-7b9f-11ee-8672-2c0da7505766(String), FORM_FIRST_NAME(String), FORM_FIRST_KEY(String), FORM_FIRST_DESCRIPTION(String), null, 2023-11-05 13:36:04.795(Timestamp), admin(String), 2023-11-05 13:36:12.429(Timestamp), admin(String), 1(Integer), {"version":0}(String), 2(Integer), 8bac7140-7b9d-11ee-8672-2c0da7505766(String), null, (String)
<== Updates: 1
Preparing: update ACT_DE_MODEL SET name = ?, model_key = ?, description = ?, model_comment = ?, created = ?, created_by = ?, last_updated = ?, last_updated_by = ?, version = ?, model_editor_json = ?, model_type = ?, thumbnail = ?, tenant_id = ? where id = ?
Parameters: FORM_FIRST_NAME(String), FORM_FIRST_KEY(String), FORM_FIRST_DESCRIPTION(String), save(String), 2023-11-05 13:36:04.795(Timestamp), admin(String), 2023-11-05 13:54:59.588(Timestamp), admin(String), 2(Integer), {"name":"FORM_FIRST_NAME","key":"FORM_FIRST_KEY","version":0,"fields":[{"fieldType":"FormField","id":"name","name":"Name","type":"text","value":null,"required":true,"readOnly":false,"overrideId":true,"placeholder":"sfq","layout":null},{"fieldType":"FormField","id":"age","name":"Age","type":"text","value":null,"required":true,"readOnly":true,"overrideId":true,"placeholder":"18","layout":null}],"outcomes":[]}(String), 2(Integer), java.io.ByteArrayInputStream@529304da(ByteArrayInputStream), (String), 8bac7140-7b9d-11ee-8672-2c0da7505766(String)
<== Updates: 1
表单查询
接口 /flowable-ui/modeler-app/rest/models?filter=forms&modelType=2&sort=modifiedDesc
GET http://127.0.0.1:8080/flowable-ui/modeler-app/rest/models?filter=forms&modelType=2&sort=modifiedDesc HTTP/1.1
select * from ACT_DE_MODEL WHERE model_type = ? and tenant_id = ? order by last_updated desc
==> Preparing: select * from ACT_DE_MODEL WHERE model_type = ? and tenant_id = ? order by last_updated desc
==> Parameters: 2(Integer), (String)
<== Total: 3
表结构
id | |
name | |
model_key | |
description | |
model_comment | |
model_type | 表单是值 2 |
model_editor_json | 表单结构定义
|
thumbnail | 表单缩略图 |
tenant_id | |
version |
类
Model: 对应ACT_DE_MODEL
ModelKeyRepresentation: 校验 key 重复的
FormRepresentation: 返回前端的 Form
SimpleFormModel: model_editor_json 的表示,就是 FormRepresentation 中的 formDefinition
标签:String,FORM,Flowable,流程,name,model,FIRST,id,Form From: https://blog.51cto.com/u_12225199/8193884