flowable 获取自定义属性值

网友投稿 1627 2022-09-17

flowable 获取自定义属性值

flowable 获取自定义属性值

背景我们在做flowable开发的时候难免会做一些自定义属性,如何去获取他们的值呢?我是一个有代码洁癖的人,如果哪里有写的不好的地方,请多多指教。代码1: 获取节点对象public FlowElement getFlowElementByActivityIdAndProcessDefinitionId(String activityId, String processDefinitionId) { BpmnModel bpmnModel = repositoryService.getBpmnModel(processDefinitionId); List processes = bpmnModel.getProcesses(); if (CollectionUtils.isNotEmpty(processes)) { for(Process process : processes) { FlowElement flowElement = process.getFlowElement(activityId); if (flowElement != null){ return flowElement; } } } return null; }2:获取节点的自定义属性/** * 获取自定义属性值 * * @param activityId 节点id * @param processDefinitionId 流程定义id * @param customPropertyName 属性名 * @return */ public List getCustomProperty(String activityId, String processDefinitionId, String customPropertyName) { FlowElement flowElement = this.getFlowElementByActivityIdAndProcessDefinitionId(activityId,processDefinitionId); if (flowElement != null && flowElement instanceof UserTask) { UserTask userTask = (UserTask) flowElement; Map> extensionElements = userTask.getExtensionElements(); if (MapUtils.isNotEmpty(extensionElements)) { List values = extensionElements.get(customPropertyName); if (CollectionUtils.isNotEmpty(values)) { return values; } } } return null; }

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:怎样禁用可移动存储设备,例如 U盘
下一篇:将十进制数据转换为二进制AND将二进制数据转换为十进制!(二进制数据转换成十进制数)
相关文章

 发表评论

暂时没有评论,来抢沙发吧~