ruoyi-flowable-plus框架节点表单的理解
背景:调试流程时报错,查找原因,发现节点表单选项有这层含义。
- 简单记录。其实还需要将保存、部署、发起、完成、拒绝等做解析的。
一、解释:系统页面理解
- 当勾选节点表单:会将选择的表单挂钩到当前任务中。
- 当勾选节点表单为
是
, 任务节点被添加属性flowable:localScope="true"
此时在查询此表单内容时就需要根据任务id(taskId)
查询了
- 通过如下方式
查询表单数据变量
// 查询模型中元素的属性
boolean localScope = Convert.toBool(ModelUtils.getElementAttributeValue(flowElement, ProcessConstants.PROCESS_FORM_LOCAL_SCOPE), false);
Map<String, Object> variables = null;
// 若勾选了节点表单
if (localScope) {// 根据任务id和流程id查询变量List<HistoricVariableInstance> instanceList = historyService.createHistoricVariableInstanceQuery().processInstanceId(historicProcIns.getId()).taskId(activityInstance.getTaskId()).list();// 查询任务节点参数,并转换成Mapif (CollUtil.isNotEmpty(instanceList)) {variables = instanceList.stream().collect(Collectors.toMap(HistoricVariableInstance::getVariableName,HistoricVariableInstance::getValue));}
} else {if (processFormKeys.contains(formKey)) {continue;}variables = historicProcIns.getProcessVariables();processFormKeys.add(formKey);
}
- 以上内容查询后是这样的内容:表结构数据查询
二、解释:数据库面理解
- act_ge和act_re字面意思:再续…
- 直接修改数据库。删除属性
flowable:localScope=“true”
表名act_ge_bytearray
- 找到
act_ge_bytearray
sql语句select * from act_ge_bytearray t where t.DEPLOYMENT_ID_ in ( select DEPLOYMENT_ID_ from act_re_procdef arp where arp.NAME_ = '援**请' and arp.VERSION_ = '54')
- sql查询找到二进制后直接删除localScope属性即可