您的位置:首页 > 科技 > IT业 > 基于jeecgboot-vue3的Flowable流程仿钉钉流程设计器-发送信息服务处理

基于jeecgboot-vue3的Flowable流程仿钉钉流程设计器-发送信息服务处理

2024/10/5 1:27:06 来源:https://blog.csdn.net/qq_40032778/article/details/140645201  浏览:    关键词:基于jeecgboot-vue3的Flowable流程仿钉钉流程设计器-发送信息服务处理

因为这个项目license问题无法开源,更多技术支持与服务请加入我的知识星球。

1、因为仿钉钉设计器里发送消息处理是一个服务任务,所以要根据这个服务任务进行处理

2、这里目前只对消息进行处理,就是用websocket的发送方式

输入相应的内容,这里也用扩展属性来处理

3、相应的后端代码如下:

public class NotifyNode extends AssigneeNode {private List<NotifyTypeEnum> types;private String subject;private String content;@Overridepublic List<FlowElement> convert() {ArrayList<FlowElement> elements = new ArrayList<>();// 服务节点ServiceTask serviceTask = new ServiceTask();serviceTask.setId(this.getId());serviceTask.setName(this.getName());serviceTask.setAsynchronous(false);serviceTask.setImplementationType(ImplementationType.IMPLEMENTATION_TYPE_CLASS);serviceTask.setImplementation("org.jeecg.modules.flowable.ServiceTask.notifyDelegate");//增加扩展属性 add by nbachengMap<String, List<ExtensionElement>> extensionElements = new HashMap<String, List<ExtensionElement>>();ExtensionElement extensionElementTotal = new ExtensionElement();extensionElementTotal.setName("flowable:properties"); ExtensionElement eElementUser = new ExtensionElement();eElementUser.setName("flowable:property");ExtensionAttribute eAttributeUserName = new ExtensionAttribute();eAttributeUserName.setName("name");eAttributeUserName.setValue("notifyUserList");eElementUser.addAttribute(eAttributeUserName);ExtensionAttribute eAttributeUserValue = new ExtensionAttribute();eAttributeUserValue.setName("value");eAttributeUserValue.setValue(StringUtils.join(this.getUsers(), ","));eElementUser.addAttribute(eAttributeUserValue);extensionElementTotal.addChildElement(eElementUser);ExtensionElement eElementSubject = new ExtensionElement();eElementSubject.setName("flowable:property");ExtensionAttribute eAttributeSubjectName = new ExtensionAttribute();eAttributeSubjectName.setName("name");eAttributeSubjectName.setValue("subject");eElementSubject.addAttribute(eAttributeSubjectName);ExtensionAttribute eAttributeSubjectValue = new ExtensionAttribute();eAttributeSubjectValue.setName("value");eAttributeSubjectValue.setValue(this.getSubject());eElementSubject.addAttribute(eAttributeSubjectValue);extensionElementTotal.addChildElement(eElementSubject);ExtensionElement eElementContent = new ExtensionElement();eElementContent.setName("flowable:property");ExtensionAttribute eAttributeContent = new ExtensionAttribute();eAttributeContent.setName("name");eAttributeContent.setValue("content");eElementContent.addAttribute(eAttributeContent);ExtensionAttribute eAttributeContentValue = new ExtensionAttribute();eAttributeContentValue.setName("value");eAttributeContentValue.setValue(this.getContent());eElementContent.addAttribute(eAttributeContentValue);extensionElementTotal.addChildElement(eElementContent);extensionElements.put("notifyUserList", CollUtil.newArrayList(extensionElementTotal));serviceTask.setExtensionElements(extensionElements);elements.add(serviceTask);// 下一个节点的连线Node child = this.getChild();SequenceFlow sequenceFlow = this.buildSequence(child);elements.add(sequenceFlow);// 下一个节点if (Objects.nonNull(child)) {child.setBranchId(this.getBranchId());List<FlowElement> flowElements = child.convert();elements.addAll(flowElements);}return elements;}
}

4、相应的效果图

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com