当前位置: 首页 > news >正文

顺德做网站的公司哪家好/软件开发培训机构去哪个学校

顺德做网站的公司哪家好,软件开发培训机构去哪个学校,手机3g网站,网站建设友汇依赖在之前的基础上:flowable-spring-boot-starter-process flowable笔记 - 环境配置org.flowableflowable-form-spring-configurator6.4.0流程和表单定义bpmn20文件官方那种使用包裹在startEvent里的方式,无法用代码获取表单,可能是用法不正…

依赖

在之前的基础上:flowable-spring-boot-starter-process flowable笔记 - 环境配置

org.flowable

flowable-form-spring-configurator

6.4.0

流程和表单定义

bpmn20文件

官方那种使用包裹在startEvent里的方式,无法用代码获取表单,可能是用法不正确。

流程和表单放在一起

...

name="Speaker"

variable="SpeakerName"

type="string" />

type="date"

datePattern="dd-MMM-yyyy" />

...

表单单独存放

flowable:class="com.baison.bap.flowable.delegate.FormViewDelegate"/>

test.form

与bpmn20文件里的flowable:formKey对应

需要放在resources/forms文件夹下

表单字段名需要全局唯一,因为值是存在流程variables里的,如果重复,会有被覆盖的情况。

{

"key": "test",

"name": "请假流程",

"fields": [

{

"id": "startTime",

"name": "开始时间",

"type": "date",

"required": true,

"placeholder": "empty"

},

{

"id": "endTime",

"name": "结束时间",

"type": "date",

"required": true,

"placeholder": "empty"

},

{

"id": "reason",

"name": "请假原因",

"type": "text",

"required": true,

"placeholder": "empty"

}

],

"outcomes": [

{

"id": "sendToParent",

"name": "发给上级"

},

{

"id": "sendToHr",

"name": "发给人事"

}

]

}

FormViewDelegate定义

使用runtimeService.getStartFormModel获取开始表单

因为表单数据实际上是存在流程variables里的,所以使用execution.getVariable()获取表单值(不过有个FormField.getValue()方法,按照常理来说,是用来获取值的,但是实际上并没有,这个不知道是否版本问题,还是其他用途的)

package com.baison.bap.flowable.delegate;

import com.baison.bap.util.SpringUtil;

import org.flowable.engine.RuntimeService;

import org.flowable.engine.delegate.DelegateExecution;

import org.flowable.engine.delegate.JavaDelegate;

import org.flowable.form.api.FormInfo;

import org.flowable.form.model.FormField;

import org.flowable.form.model.SimpleFormModel;

import java.util.List;

public class FormViewDelegate implements JavaDelegate {

private RuntimeService runtimeService = SpringUtil.getBean(RuntimeService.class);

@Override

public void execute(DelegateExecution execution) {

FormInfo info = runtimeService.getStartFormModel(execution.getProcessDefinitionId(), execution.getProcessInstanceId());

SimpleFormModel sfm = (SimpleFormModel) info.getFormModel();

List fields = sfm.getFields();

for (FormField ff : fields) {

System.out.println();

System.out.println("id: " + ff.getId());

System.out.println("name: " + ff.getName());

System.out.println("type: " + ff.getType());

System.out.println("placeholder: " + ff.getPlaceholder());

System.out.println("value: " + ff.getValue());

System.out.println("value from variable: " + execution.getVariable(ff.getId()));

System.out.println();

}

}

}

获取流程表单

流程中的表单有两种:流程开始表单和流程中表单

查看是否有表单

// 流程开始表单

ProcessDefinition.hasStartFormKey();

// 流程中表单

Task.getFormKey();

获取开始流程表单

ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionKey(code).latestVersion().singleResult();

StartFormData form = formService.getStartFormData(pd.getId());

FormInfo info = formRepositoryService.getFormModelByKey(form.getFormKey());

info.getFormModel();

获取流程中用户需要填写的表单

TaskFormData form = formService.getTaskFormData(taskId);

填写表单

runtimeService.startProcessInstanceWithForm和formService.submitStartFormData都能填写完成表单并开始流程

也就是说其实表单填写的数据都是放在variables里的

开始表单

ProcessDefinition pd = repositoryService.createProcessDefinitionQuery().processDefinitionKey("formRequest").latestVersion().singleResult();

Map properties = new HashMap<>();

properties.put("startTime", "2018-12-14");

properties.put("endTime", "2018-12-20");

properties.put("reason", "回家");

// ProcessInstance pi = runtimeService.startProcessInstanceWithForm(pd.getId(), "sendToParent", properties, null);

ProcessInstance pi = formService.submitStartFormData(pd.getId(), UUID.randomUUID().toString(), properties);

流程中表单

TaskService.completeTaskWithForm(String taskId, String formDefinitionId, String outcome, Map variables)

原文:https://www.cnblogs.com/xwbz/p/10130654.html

http://www.jmfq.cn/news/4865473.html

相关文章:

  • 做鸭子的网站/网页设计可以自学吗
  • 如何识别网站建设/东莞网站建设做网站
  • 济南网站建设公司熊掌号/收录情况
  • 贵州安顺网站建设/品牌推广软文案例
  • 如何做网站测试/百度大数据查询怎么用
  • 怎么建立免费个人网站/重庆森林电影
  • 赞美对方公司网站做的好的日语/网上推广怎么收费
  • 专业的网站建设服务交易平台/怎么做网络销售
  • 台州哪里做网站/培训机构专业
  • 天津网站建设报价/搜索引擎优化学习
  • adobe做网站的软件/360安全浏览器
  • 中国最大的网站/临沂网站建设方案服务
  • 网站开发的检索速度在啥范围之内/线下推广有哪些渠道
  • 厦门网站建设网页设计/弹窗广告最多的网站
  • 自己做社交网站/输入关键词自动生成标题
  • 大学网站建设多少钱/网络营销案例分析
  • phpstudy做正式网站/重庆企业免费建站
  • 如何做教育网站/新闻发布平台有哪些
  • 如何提升顾客的体验和服务/小时seo
  • 施工企业环境管理体系/优化网站推广教程整站
  • 芯互联大厦做网站的/百度图片识别
  • 阜阳网站建设公司/图片优化
  • 网站自己怎么制作/怎么推广自己的微信号
  • 公司网站建设ppt/百度的代理商有哪些
  • 网站建设策划方案/百度关键词搜索排行
  • 网络规划设计师教程(第2版)/搜索引擎排名优化价格
  • 海北wap网站建设/最近一周热点新闻
  • 百度怎么收录自己的网站/nba体育新闻
  • wordpress.分页工具/seo北京
  • 站长之家网站素材/北京网站快速优化排名