Movatterモバイル変換


[0]ホーム

URL:


CN114493479A - Implementation method and system of enterprise-level workflow engine based on microservice SaaS - Google Patents

Implementation method and system of enterprise-level workflow engine based on microservice SaaS
Download PDF

Info

Publication number
CN114493479A
CN114493479ACN202111556056.1ACN202111556056ACN114493479ACN 114493479 ACN114493479 ACN 114493479ACN 202111556056 ACN202111556056 ACN 202111556056ACN 114493479 ACN114493479 ACN 114493479A
Authority
CN
China
Prior art keywords
approval
node
business
service
enterprise
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202111556056.1A
Other languages
Chinese (zh)
Other versions
CN114493479B (en
Inventor
漆翔宇
牛佳庆
于鹏
史蕊
欧志伟
吴坚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Zhenyun Information Technology Co ltd
Original Assignee
Shanghai Zhenyun Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Zhenyun Information Technology Co ltdfiledCriticalShanghai Zhenyun Information Technology Co ltd
Priority to CN202111556056.1ApriorityCriticalpatent/CN114493479B/en
Publication of CN114493479ApublicationCriticalpatent/CN114493479A/en
Application grantedgrantedCritical
Publication of CN114493479BpublicationCriticalpatent/CN114493479B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

基于微服务SaaS的企业级工作流引擎实现方法及系统,通过在线流程设计器进行流程定义,根据BPMN2.0协议增加扩展节点存储自定义的业务化配置,业务化配置包括审批规则、审批方式、跳转条件和服务调用;预先进行流程表单定义,流程表单包括只读表单和可编辑表单,通过流程表单在审批时展示业务单据详情;通过审批规则在人工节点查找审批人员,通过审批方式判断在是否满足指定条件时离开当前人工节点继续向下流转,通过跳转条件控制流程分支走向,通过服务调用在指定节点远程调用业务模块执行自定义逻辑。本发明实现多租户及多种业务场景下审批流高可维护性以及高可扩展性,使得工作流引擎的可用性得到极大的提高。

Figure 202111556056

The implementation method and system of enterprise-level workflow engine based on micro-service SaaS, the process is defined through the online process designer, and the expansion node is added according to the BPMN2.0 protocol to store the customized business configuration. The business configuration includes approval rules, approval methods, Jump conditions and service calls; define process forms in advance, including read-only forms and editable forms, and display business document details during approval through process forms; find approvers in manual nodes through approval rules, and determine whether they are in the process of approval through approval methods. When the specified conditions are met, leave the current artificial node and continue to flow downward, control the direction of the process branch through the jump conditions, and remotely call the business module at the specified node to execute the custom logic through the service call. The present invention realizes high maintainability and high scalability of the approval flow under multi-tenancy and various business scenarios, so that the availability of the workflow engine is greatly improved.

Figure 202111556056

Description

Translated fromChinese
基于微服务SaaS的企业级工作流引擎实现方法及系统Implementation method and system of enterprise-level workflow engine based on microservice SaaS

技术领域technical field

本发明涉及一种基于微服务SaaS的企业级工作流引擎实现方法及系统,属于业务数据处理技术领域。The invention relates to an enterprise-level workflow engine implementation method and system based on micro-service SaaS, and belongs to the technical field of business data processing.

背景技术Background technique

随着业务的发展,采用传统本地部署软件的企业往往跟不上企业的发展速度和战略变化。本地部署存在运维成本高,升级困难,个性化需求难以及时满足等问题。于是,SaaS平台应运而生,软件即服务,供应商统一将软件部署在云服务器上统一运维,客户只需缴纳一定的订阅费即可使用服务,并可灵活购买扩展服务,定制化开发。而企业信息审批流程化,也是企业发展的必经之路,OA系统,财务系统几乎绝大多数业务复杂的系统都需要工作流引擎来打通人工审批和系统自动化。As the business grows, enterprises that use traditional on-premises software often cannot keep up with the pace of development and strategic changes. Local deployment has problems such as high operation and maintenance costs, difficult upgrades, and difficulty in meeting individual requirements in a timely manner. As a result, the SaaS platform came into being, software as a service, and suppliers deployed software on cloud servers for unified operation and maintenance. Customers only need to pay a certain subscription fee to use the service, and they can flexibly purchase extended services for customized development. The process of enterprise information approval is also the only way for enterprise development. OA systems, financial systems, and almost most systems with complex business require a workflow engine to get through manual approval and system automation.

传统的工作流引擎一般分为内置和外置,内置即直接将工作流引擎集成到某一业务系统中,比如OA系统的工作流引擎,它直接与OA系统耦合在一起,灵活性不足,适用面也很窄。外置工作流引擎则一般是独立部署的,作为第三方系统与各个系统打通。现有的主流使用的业务系统中需要接入审批流程,通常是一个场景接入审批流就需要做一个复杂的流程设计。每个场景的审批内容不同,提交给审批人审核查看的表单内容是变化的,导致审核详情页面也不同。因此,目前业务系统的业务审批处理,需要由专业的审批人员人工对待审批的业务请求进行核实确认,最后作出对应决策,审批效率低,而且业务审批处理受审批人员个人因素影响大,审批决策的准确度有限。The traditional workflow engine is generally divided into built-in and external. The built-in directly integrates the workflow engine into a certain business system, such as the workflow engine of the OA system, which is directly coupled with the OA system and lacks flexibility. The face is also very narrow. The external workflow engine is generally deployed independently, and is connected with each system as a third-party system. The existing mainstream business system needs to be connected to the approval process. Usually, a scenario needs to be connected to the approval flow and requires a complex process design. The approval content of each scenario is different, and the content of the form submitted to the approver for review and viewing changes, resulting in different review details pages. Therefore, the current business approval processing of the business system requires professional approvers to manually verify and confirm the approved business requests, and finally make corresponding decisions. The approval efficiency is low, and the business approval processing is greatly affected by the personal factors of the approvers. Accuracy is limited.

发明内容SUMMARY OF THE INVENTION

为此,本发明提供一种基于微服务SaaS的企业级工作流引擎实现方法及系统,克服现有SaaS平台租户工作流引擎配置复杂、使用成本较高、功能不完善等问题,实现多租户及多种业务场景下审批流高可维护性以及高可扩展性。Therefore, the present invention provides an enterprise-level workflow engine implementation method and system based on micro-service SaaS, which overcomes the problems of complex configuration, high use cost, and imperfect functions of the existing SaaS platform tenant workflow engine, and realizes multi-tenant and The approval flow is highly maintainable and scalable in various business scenarios.

为了实现上述目的,本发明提供如下技术方案:基于微服务SaaS的企业级工作流引擎实现方法,包括:In order to achieve the above purpose, the present invention provides the following technical solutions: an enterprise-level workflow engine implementation method based on micro-service SaaS, including:

通过在线流程设计器进行流程定义,根据BPMN2.0协议增加扩展节点存储自定义的业务化配置,所述业务化配置包括审批规则、审批方式、跳转条件和服务调用;The process is defined by the online process designer, and the expansion node is added according to the BPMN2.0 protocol to store the customized business configuration, and the business configuration includes approval rules, approval methods, jump conditions and service calls;

预先进行流程表单定义,所述流程表单包括只读表单和可编辑表单,通过所述流程表单在审批时展示业务单据详情;Define a process form in advance, the process form includes a read-only form and an editable form, and the business document details are displayed during approval through the process form;

通过所述审批规则在人工节点查找审批人员,通过所述审批方式判断在是否满足指定条件时离开当前人工节点继续向下流转,通过所述跳转条件控制流程分支走向,通过所述服务调用在指定节点远程调用业务模块执行自定义逻辑。Find the approver at the artificial node through the approval rule, judge whether the specified condition is satisfied by the approval method, and leave the current artificial node and continue to flow downward, control the flow branch direction through the jump condition, and call the service at the The specified node remotely invokes the business module to execute custom logic.

作为基于微服务SaaS的企业级工作流引擎实现方法的优选方案,所述只读表单通过iframe实现,所述可编辑表单通过动态路由和异步加载实现跨模块加载页面。As a preferred solution of the implementation method of the enterprise-level workflow engine based on microservice SaaS, the read-only form is implemented by iframe, and the editable form is implemented by dynamic routing and asynchronous loading to load pages across modules.

作为基于微服务SaaS的企业级工作流引擎实现方法的优选方案,所述流程表单的定义包含表单对应的前端路由;As a preferred solution of the microservice SaaS-based enterprise-level workflow engine implementation method, the definition of the process form includes the front-end route corresponding to the form;

在设计流程图过程,对任意人工节点配置审批表单,将审批表单编码存储到当前节点;In the process of designing the flowchart, configure the approval form for any artificial node, and store the approval form code to the current node;

在审批过程,依据表单编码和流程变量动态解析表单地址。During the approval process, the form address is dynamically resolved according to the form code and process variables.

作为基于微服务SaaS的企业级工作流引擎实现方法的优选方案,所述业务化配置中保存的为服务定义编码,在启动流程时,动态解析流程节点中的服务定义编码;As a preferred solution of the microservice SaaS-based enterprise-level workflow engine implementation method, the service definition code is stored in the business configuration, and when the process is started, the service definition code in the process node is dynamically parsed;

当所述审批规则不满足业务场景时,通过自定义创建审批规则编写找人逻辑。When the approval rule does not meet the business scenario, the search logic is written by creating an approval rule by definition.

作为基于微服务SaaS的企业级工作流引擎实现方法的优选方案,还包括,通过预先定义邮件模版和渲染邮件模版所需数据的来源,在流程定义的人工节点中选择所需邮件模板,将模版编码保存在人工节点中;As a preferred solution of the enterprise-level workflow engine implementation method based on microservice SaaS, it also includes: by predefining the email template and the source of the data required for rendering the email template, selecting the required email template in the artificial node of the process definition, and converting the template to the template. The code is stored in the artificial node;

当流程启动时,依据模版编码获取邮件模版配置,通过Free marker引擎结合预先定义的数据来源动态渲染邮件内容,最终通过消息服务发送给审批人。When the process starts, the email template configuration is obtained according to the template code, and the content of the email is dynamically rendered by the Free marker engine combined with the pre-defined data sources, and finally sent to the approver through the message service.

作为基于微服务SaaS的企业级工作流引擎实现方法的优选方案,还包括,根据监听器的执行时期进行消息埋点,在不同时期对不同的审批人发送不同的消息类型。As a preferred solution of the implementation method of the enterprise-level workflow engine based on the microservice SaaS, it also includes: performing message embedding according to the execution period of the listener, and sending different message types to different approvers in different periods.

作为基于微服务SaaS的企业级工作流引擎实现方法的优选方案,以当前待办实例作为父类创建子类待办实例,重置父类的审批人为指定类型,指定类型依据加签类型决定,加签类型包括前加签和后加签;As the preferred solution for the implementation of enterprise-level workflow engine based on microservice SaaS, use the current to-do instance as the parent class to create a sub-class to-do instance, reset the approver of the parent class to the specified type, and the specified type is determined according to the signature type. The types of signatures include pre- signature and post- signature;

删除当前审批人审批的待办实例,依据加签类型控制流程流转,前加签回溯到原始审批人,后加签依据流程图继续向下流转;Delete the to-do instance approved by the current approver, and control the flow of the process according to the type of signature. The former signature can be traced back to the original approver, and the latter signature will continue to flow downward according to the flow chart;

依据当前审批人获取最近一次审批过的节点,删除当前节点的所有待办实例,将当前流程回溯到指定节点。Obtain the last approved node according to the current approver, delete all to-do instances of the current node, and trace the current process back to the specified node.

作为基于微服务SaaS的企业级工作流引擎实现方法的优选方案,对相同分类下的流程定义,通过预先配置业务参数组,指定不同业务参数组关联不同的流程定义,以达到启动工作流时,通过业务参数动态选择流程定义并启动工作流。As the preferred solution of the enterprise-level workflow engine implementation method based on micro-service SaaS, for the process definitions under the same classification, by pre-configuring business parameter groups, specifying different business parameter groups to associate with different process definitions, so as to achieve, when starting the workflow, Dynamically select process definitions and start workflows with business parameters.

本发明还提供一种基于微服务SaaS的企业级工作流引擎实现系统,包括:The present invention also provides an enterprise-level workflow engine implementation system based on micro-service SaaS, including:

流程定义单元,用于通过在线流程设计器进行流程定义,根据BPMN2.0协议增加扩展节点存储自定义的业务化配置,所述业务化配置包括审批规则、审批方式、跳转条件和服务调用;The process definition unit is used to define the process through the online process designer, and add an extension node according to the BPMN2.0 protocol to store a customized business configuration, and the business configuration includes approval rules, approval methods, jump conditions and service calls;

表单定义单元,用于预先进行流程表单定义,所述流程表单包括只读表单和可编辑表单,通过所述流程表单在审批时展示业务单据详情;The form definition unit is used to define a process form in advance, the process form includes a read-only form and an editable form, and the business document details are displayed during approval through the process form;

任务处理单元,用于通过所述审批规则在人工节点查找审批人员,通过所述审批方式判断在是否满足指定条件时离开当前人工节点继续向下流转,通过所述跳转条件控制流程分支走向,通过所述服务调用在指定节点远程调用业务模块执行自定义逻辑。A task processing unit, configured to search for an approver at an artificial node through the approval rule, determine whether to leave the current artificial node and continue to flow downward through the approval method when a specified condition is met, and control the flow branch direction through the jump condition, Through the service invocation, the business module is remotely invoked at the specified node to execute the custom logic.

作为基于微服务SaaS的企业级工作流引擎实现系统的优选方案,所述只读表单通过iframe实现,所述可编辑表单通过动态路由和异步加载实现跨模块加载页面。As a preferred solution for implementing the system for an enterprise-level workflow engine based on microservice SaaS, the read-only form is implemented through iframe, and the editable form implements cross-module loading of pages through dynamic routing and asynchronous loading.

作为基于微服务SaaS的企业级工作流引擎实现系统的优选方案,所述流程表单的定义包含表单对应的前端路由;As a preferred solution of the enterprise-level workflow engine implementation system based on microservice SaaS, the definition of the process form includes the front-end route corresponding to the form;

在设计流程图过程,对任意人工节点配置审批表单,将审批表单编码存储到当前节点;In the process of designing the flowchart, configure the approval form for any artificial node, and store the approval form code to the current node;

在审批过程,依据表单编码和流程变量动态解析表单地址。During the approval process, the form address is dynamically resolved according to the form code and process variables.

作为基于微服务SaaS的企业级工作流引擎实现系统的优选方案,所述业务化配置中保存的为服务定义编码,在启动流程时,动态解析流程节点中的服务定义编码;As a preferred solution of the enterprise-level workflow engine implementation system based on microservice SaaS, the service definition code is stored in the business configuration, and when the process is started, the service definition code in the process node is dynamically parsed;

当所述审批规则不满足业务场景时,通过自定义创建审批规则编写找人逻辑。When the approval rule does not meet the business scenario, the search logic is written by creating an approval rule by definition.

作为基于微服务SaaS的企业级工作流引擎实现系统的优选方案,还包括邮件审批单元,用于通过预先定义邮件模版和渲染邮件模版所需数据的来源,在流程定义的人工节点中选择所需邮件模板,将模版编码保存在人工节点中。As a preferred solution for implementing the system based on the microservice SaaS enterprise-level workflow engine, it also includes an email approval unit, which is used to select the required data from the artificial nodes of the process definition by pre-defining the email template and the source of the data required for rendering the email template. Email template, save the template code in the artificial node.

作为基于微服务SaaS的企业级工作流引擎实现系统的优选方案,当流程启动时,依据模版编码获取邮件模版配置,通过Free marker引擎结合预先定义的数据来源动态渲染邮件内容,最终通过消息服务发送给审批人。As the preferred solution for implementing the system based on the microservice SaaS enterprise-level workflow engine, when the process starts, the email template configuration is obtained according to the template code, and the content of the email is dynamically rendered by the Free marker engine combined with the pre-defined data sources, and finally sent through the message service. to approvers.

作为基于微服务SaaS的企业级工作流引擎实现系统的优选方案,还包括消息提醒单元,用于根据监听器的执行时期进行消息埋点,在不同时期对不同的审批人发送不同的消息类型。As the preferred solution of the enterprise-level workflow engine implementation system based on microservice SaaS, it also includes a message reminder unit, which is used for message embedding according to the execution period of the listener, and sends different message types to different approvers in different periods.

作为基于微服务SaaS的企业级工作流引擎实现系统的优选方案,还包括加签单元,用于以当前待办实例作为父类创建子类待办实例,重置父类的审批人为指定类型,指定类型依据加签类型决定,加签类型包括前加签和后加签;删除当前审批人审批的待办实例,依据加签类型控制流程流转,前加签回溯到原始审批人,后加签依据流程图继续向下流转。As a preferred solution for implementing the system of enterprise-level workflow engine based on micro-service SaaS, it also includes a signing unit, which is used to create a sub-class to-do instance with the current to-do instance as the parent class, and reset the approver of the parent class to the specified type. The specified type is determined according to the type of signature. The type of signature includes pre- signature and post- signature; delete the to-do instance approved by the current approver, and control the flow of the process according to the type of signature. Continue to flow downwards according to the flow chart.

作为基于微服务SaaS的企业级工作流引擎实现系统的优选方案,还包括撤回单元,用于依据当前审批人获取最近一次审批过的节点,删除当前节点的所有待办实例,将当前流程回溯到指定节点。As the preferred solution for implementing the system of enterprise-level workflow engine based on microservice SaaS, it also includes a withdrawal unit, which is used to obtain the last approved node according to the current approver, delete all to-do instances of the current node, and trace the current process back to Specifies the node.

作为基于微服务SaaS的企业级工作流引擎实现系统的优选方案,还包括启动处理单元,用于对相同分类下的流程定义,通过预先配置业务参数组,指定不同业务参数组关联不同的流程定义,以达到启动工作流时,通过业务参数动态选择流程定义并启动工作流。As a preferred solution for implementing the system based on the microservice SaaS enterprise-level workflow engine, it also includes a startup processing unit, which is used to define the processes under the same classification, by pre-configuring business parameter groups, and specifying different business parameter groups to associate with different process definitions. , so that when the workflow is started, the process definition is dynamically selected through business parameters and the workflow is started.

本发明具有如下优点:通过在线流程设计器进行流程定义,根据BPMN2.0协议增加扩展节点存储自定义的业务化配置,业务化配置包括审批规则、审批方式、跳转条件和服务调用;预先进行流程表单定义,流程表单包括只读表单和可编辑表单,通过流程表单在审批时展示业务单据详情;通过审批规则在人工节点查找审批人员,通过审批方式判断在是否满足指定条件时离开当前人工节点继续向下流转,通过跳转条件控制流程分支走向,通过服务调用在指定节点远程调用业务模块执行自定义逻辑。本发明提升流程启动的高扩展性,基于规则引擎工作流引擎接收业务参数后基于启动流程审批实例,满足实际业务同一租户下不同公司审批流差异性;增强流程引擎的其他服务或外部系统协作性,流程审批支持嵌入定制化的表单,并可使用业务表单中的业务数据配置化控制后续流程流转;运行中支持支持移动端、PC端及邮件审批方式进行处理;通过监听器执行跨服务的任务调度,实现多个微服务的业务协作;降低流程引擎开发难度与代码量,便于需求扩展和协同开发以及维护;用户及实施人员使用配置化,可视化流程图配置、配置图可导出XML文件多环境迁移、及系统内消息提醒或外部消息提醒协作,提升工作流引擎使用便携性与友好性。The invention has the following advantages: the process is defined through the online process designer, and the expansion node is added according to the BPMN2.0 protocol to store the customized business configuration. The business configuration includes approval rules, approval methods, jump conditions and service calls; Process form definition. Process forms include read-only forms and editable forms. The business document details are displayed during approval through the process form. The approval rules are used to find the approvers in the manual node, and the approval method is used to determine whether to leave the current manual node when the specified conditions are met. Continue to flow downward, control the direction of the process branch through the jump condition, and remotely call the business module to execute the custom logic at the specified node through the service call. The invention improves the high scalability of process startup, and the workflow engine based on the rule engine receives the business parameters and approves the instance based on the startup process, which satisfies the difference of the approval flow of different companies under the same tenant of the actual business; and enhances the collaboration of other services or external systems of the process engine. , Process approval supports embedding customized forms, and can use the business data in the business form to configure and control the subsequent process flow; support mobile, PC and email approval methods for processing during operation; perform cross-service tasks through listeners Scheduling to realize business collaboration of multiple microservices; reduce the difficulty of process engine development and the amount of code, facilitate demand expansion, collaborative development and maintenance; users and implementers can use configuration, visualize flowchart configuration, and configuration diagrams can export XML files to multiple environments Migration, and collaboration with in-system message reminders or external message reminders, improve the portability and friendliness of the workflow engine.

附图说明Description of drawings

为了更清楚地说明本发明的实施方式或现有技术中的技术方案,下面将对实施方式或现有技术描述中所需要使用的附图作简单地介绍。显而易见地,下面描述中的附图仅仅是示例性的,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图引伸获得其它的实施附图。In order to illustrate the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that are required to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only exemplary, and for those of ordinary skill in the art, other implementation drawings can also be obtained according to the extension of the drawings provided without creative efforts.

本说明书所绘示的结构、比例、大小等,均仅用以配合说明书所揭示的内容,以供熟悉此技术的人士了解与阅读,并非用以限定本发明可实施的限定条件,故不具技术上的实质意义,任何结构的修饰、比例关系的改变或大小的调整,在不影响本发明所能产生的功效及所能达成的目的下,均应仍落在本发明所揭示的技术内容能涵盖的范围内。The structures, proportions, sizes, etc. shown in this specification are only used to cooperate with the contents disclosed in the specification, so as to be understood and read by those who are familiar with the technology, and are not used to limit the conditions for the implementation of the present invention, so there is no technical The substantive meaning, any modification of the structure, the change of the proportional relationship or the adjustment of the size, without affecting the effect that the present invention can produce and the purpose that can be achieved, should still fall within the technical content disclosed in the present invention. within the scope of coverage.

图1为本发明实施例中提供的基于微服务SaaS的企业级工作流引擎实现方法示意图;1 is a schematic diagram of a method for implementing an enterprise-level workflow engine based on microservice SaaS provided in an embodiment of the present invention;

图2为本发明实施例中提供的基于微服务SaaS的企业级工作流引擎实现方法技术路线;2 is a technical route of an enterprise-level workflow engine implementation method based on microservice SaaS provided in an embodiment of the present invention;

图3为本发明实施例中提供的基于微服务SaaS的企业级工作流引擎实现方法中加签示意图;3 is a schematic diagram of adding a signature in an implementation method of an enterprise-level workflow engine based on microservice SaaS provided in an embodiment of the present invention;

图4为本发明实施例中提供的基于微服务SaaS的企业级工作流引擎实现系统示意图。FIG. 4 is a schematic diagram of an implementation system of an enterprise-level workflow engine based on microservice SaaS provided in an embodiment of the present invention.

具体实施方式Detailed ways

以下由特定的具体实施例说明本发明的实施方式,熟悉此技术的人士可由本说明书所揭露的内容轻易地了解本发明的其他优点及功效,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The embodiments of the present invention are described below by specific specific embodiments. Those who are familiar with the technology can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. Obviously, the described embodiments are part of the present invention. , not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

实施例1Example 1

参见图1和图2,本发明实施例1提供一种基于微服务SaaS的企业级工作流引擎实现方法,包括:Referring to FIG. 1 and FIG. 2,Embodiment 1 of the present invention provides an enterprise-level workflow engine implementation method based on micro-service SaaS, including:

S1、通过在线流程设计器进行流程定义,根据BPMN2.0协议增加扩展节点存储自定义的业务化配置,业务化配置包括审批规则、审批方式、跳转条件和服务调用;S1. Define the process through the online process designer, and add an extension node according to the BPMN2.0 protocol to store the customized business configuration. The business configuration includes approval rules, approval methods, jump conditions and service calls;

S2、预先进行流程表单定义,流程表单包括只读表单和可编辑表单,通过流程表单在审批时展示业务单据详情;S2. Define the process form in advance. The process form includes a read-only form and an editable form, and the business document details are displayed during approval through the process form;

S3、通过审批规则在人工节点查找审批人员,通过审批方式判断在是否满足指定条件时离开当前人工节点继续向下流转,通过跳转条件控制流程分支走向,通过服务调用在指定节点远程调用业务模块执行自定义逻辑。S3. Find the approver at the artificial node through the approval rule, judge whether the specified condition is met by the approval method, and leave the current artificial node and continue to flow downward, control the direction of the process branch through the jump condition, and remotely call the business module at the specified node through the service call Execute custom logic.

本实施中,基于Activiti官方标准在线流程设计器,针对业务场景定制化流程功能配置,扩展BPMN2.0协议,增加扩展节点,存储自定义的业务化配置,包含审批规则、审批方式、跳转条件和服务调用等配置。可基于BPMN2.0协议流程的导入导出,从而实现流程多环境、多系统迁移,即“一次配置,到处使用”,客户在使用SaaS平台时,可以直接在线配置或导入已有流程图。In this implementation, based on Activiti's official standard online process designer, the process function configuration is customized for business scenarios, the BPMN2.0 protocol is extended, extension nodes are added, and the customized business configuration is stored, including approval rules, approval methods, and jump conditions. and configuration of service calls. It can be based on the import and export of BPMN2.0 protocol process, so as to realize multi-environment and multi-system migration of process, that is, "configure once, use everywhere", when customers use the SaaS platform, they can directly configure or import existing flowcharts online.

具体的,Activiti是一个独立运作和经营的开源项目品牌,是一种轻量级,可嵌入的BPM引擎,而且还设计适用于可扩展的云架构。Activiti提供宽松的Apache许可2.0,以便这个项目可以广泛被使用,同时促进Activiti BPM引擎和BPMN 2.0的匹配。BPMN2.0较BPMN1.x而言,定义了流程的元模型和执行语义,即BPMN2.0解决了存储、交换和执行的问题。Specifically, Activiti is an independently operated and operated open source project brand, a lightweight, embeddable BPM engine, but also designed for scalable cloud architectures. Activiti provides the permissive Apache License 2.0 so that this project can be widely used, while facilitating the matching of the Activiti BPM engine and BPMN 2.0. Compared with BPMN1.x, BPMN2.0 defines the meta-model and execution semantics of the process, that is, BPMN2.0 solves the problems of storage, exchange and execution.

本实施例中,只读表单通过iframe实现,可编辑表单通过动态路由和异步加载实现跨模块加载页面。流程表单的定义包含表单对应的前端路由;在设计流程图过程,对任意人工节点配置审批表单,将审批表单编码存储到当前节点;在审批过程,依据表单编码和流程变量动态解析表单地址。In this embodiment, the read-only form is implemented by iframe, and the editable form is implemented by dynamic routing and asynchronous loading to load pages across modules. The definition of the process form includes the front-end route corresponding to the form; in the process of designing the flowchart, configure the approval form for any artificial node, and store the approval form code to the current node; in the approval process, dynamically resolve the form address according to the form code and process variables.

具体的,流程表单用于在审批时展示业务单据详情。包括只读表单和可编辑表单两种类型。只读表单基于iframe实现,可编辑表单基于动态路由加上异步加载实现跨模块加载页面。通过预先定义流程表单,主要包含表单对应的前端路由。在设计流程图时,可针对任意人工节点配置审批表单,将审批表单编码存储到当前节点。在审批时,工作流引擎依据表单编码和流程变量动态解析表单地址,可实现在不修改流程定义的前提下更改表单。Specifically, the process form is used to display the details of business documents during approval. There are two types: read-only forms and editable forms. Read-only forms are implemented based on iframes, and editable forms are based on dynamic routing plus asynchronous loading to load pages across modules. By pre-defining the process form, it mainly includes the front-end routing corresponding to the form. When designing a flowchart, an approval form can be configured for any artificial node, and the approval form code can be stored in the current node. During approval, the workflow engine dynamically parses the form address according to the form code and process variables, so that the form can be changed without modifying the process definition.

具体的,iframe是HTML标签,作用是文档中的文档,或者浮动的框架。iframe元素会创建包含另外一个文档的内联框架(即行内框架)。Specifically, an iframe is an HTML tag that acts as a document within a document, or a floating frame. The iframe element creates an inline frame (ie, an inline frame) that contains another document.

本实施例中,可以将审批规则、审批方式、跳转条件、服务调用四种控制流程走向的业务控制统一抽象为服务任务。通过事先定义,客户可直接在流程设计中选择以上高阶配置来实现更复杂的流程走向。In this embodiment, the business control of the four control process trends, including the approval rule, the approval method, the jump condition, and the service invocation, can be abstracted into a service task. By defining in advance, customers can directly select the above high-level configurations in the process design to realize more complex process trends.

以上审批规则、审批方式、跳转条件、服务调用支持远程调用、表达式等方式。远程调用基于Rest Template进行调用,表达式基于odyssus实现表达式解析。The above approval rules, approval methods, jump conditions, and service calls support remote calls and expressions. The remote call is based on Rest Template, and the expression is based on odyssus to implement expression parsing.

本实施例中,业务化配置中保存的为服务定义编码,在启动流程时,动态解析流程节点中的服务定义编码;In this embodiment, the service definition code is stored in the business configuration, and when the process is started, the service definition code in the process node is dynamically parsed;

当审批规则不满足业务场景时,通过自定义创建审批规则编写找人逻辑。When the approval rules do not meet the business scenario, you can write the search logic by creating custom approval rules.

具体的,流程定义中保存的均为服务定义编码,在启动流程时,工作流引擎动态解析流程节点中的服务定义编码,从而实现修改服务定义后无须再修改流程定义,一定程度实现了功能不受流程定义版本控制,提高了工作流引擎同其他微服务交互的灵活性,最终支持更多更复杂的业务场景,如在系统内置的审批规则不满足业务场景时,支持自定义创建审批规则在其他微服务中编写找人逻辑。Specifically, the service definition codes are stored in the process definition. When the process is started, the workflow engine dynamically parses the service definition codes in the process nodes, so that the process definition does not need to be modified after the service definition is modified. It is controlled by the process definition version, which improves the flexibility of the workflow engine to interact with other microservices, and finally supports more and more complex business scenarios. For example, when the built-in approval rules in the system do not meet the business scenarios, it supports custom creation Write finding logic in other microservices.

本实施例中,还包括S4,通过预先定义邮件模版和渲染邮件模版所需数据的来源,在流程定义的人工节点中选择所需邮件模板,将模版编码保存在人工节点中;In this embodiment, it also includes S4, by pre-defining the email template and the source of the data required for rendering the email template, selecting the required email template in the artificial node of the process definition, and saving the template code in the artificial node;

当流程启动时,依据模版编码获取邮件模版配置,通过Free marker引擎结合预先定义的数据来源动态渲染邮件内容,最终通过消息服务发送给审批人。When the process starts, the email template configuration is obtained according to the template code, and the content of the email is dynamically rendered by the Free marker engine combined with the pre-defined data sources, and finally sent to the approver through the message service.

具体的,通过预先定义邮件模版及渲染模版所需数据的来源,在流程定义人工节点中选择所需邮件模板,最终将模版编码保存在人工节点中。流程启动时工作流引擎将依据模版编码获取邮件模版配置,通过Free marker引擎结合预先定义的数据来源动态渲染邮件内容,最终通过消息服务发送给审批人。Specifically, by predefining the email template and the source of the data required for rendering the template, selecting the required email template in the process definition manual node, and finally saving the template code in the manual node. When the process starts, the workflow engine will obtain the email template configuration based on the template code, dynamically render the email content through the Free marker engine combined with the pre-defined data sources, and finally send it to the approver through the message service.

邮件可以附带审批同意和审批拒绝按钮,并在按钮中设置mailto为邮箱收件服务器地址,邮件主题包含审批待办所必需数据。审批人可通过点击对应按钮输入审批意见后回复邮件即可,工作流引擎通过定时任务扫描邮箱服务器收件箱,依据收件信息完成对流程的审批。The email can be attached with approval and approval buttons, and set mailto in the button as the email recipient server address, and the subject of the email contains the necessary data for approval to be done. The approver can click the corresponding button to enter the approval comments and then reply to the email. The workflow engine scans the inbox of the mailbox server through the scheduled task, and completes the approval of the process according to the receipt information.

本实施例中,还包括S5,根据监听器的执行时期进行消息埋点,在不同时期对不同的审批人发送不同的消息类型。In this embodiment, S5 is further included, where messages are buried according to the execution period of the listener, and different message types are sent to different approvers in different periods.

具体的,Activiti人工节点提供了create(创建)、assignment(任务)、complete(完成)、delete(删除)等四个监听器执行时期,本发明扩展了leave离开时期,即在满足审批方式离开人工节点时执行。基于以上五种执行时期进行消息埋点,在不同时期针对不同的审批人发送不同的消息类型,最终于系统内提醒审批人,且支持对接外部系统,达到外部系统的待办提醒。Specifically, the Activiti artificial node provides four listener execution periods, such as create (create), assignment (task), complete (complete), and delete (delete). Node is executed. Based on the above five execution periods, message embedding is carried out, and different message types are sent to different approvers in different periods. Finally, the approvers are reminded in the system, and the connection with external systems is supported to achieve to-do reminders for external systems.

参见图3,本实施例中,以当前待办实例作为父类创建子类待办实例,重置父类的审批人为指定类型,指定类型依据加签类型决定,加签类型包括前加签和后加签;Referring to FIG. 3, in this embodiment, a subclass to-do instance is created with the current to-do instance as the parent class, and the approver of the parent class is reset to the specified type. sign later;

通过加签创建的待办审批的执行过程中,删除当前审批人审批的待办实例,依据加签类型控制流程流转,前加签回溯到原始审批人,后加签依据流程图继续向下流转;During the execution of the pending approval created by adding a signature, delete the to-do instance approved by the current approver, and control the flow of the process according to the type of the signature. ;

撤回过程中,依据当前审批人获取最近一次审批过的节点,删除当前节点的所有待办实例,将当前流程回溯到指定节点。During the withdrawal process, according to the current approver to obtain the last approved node, delete all to-do instances of the current node, and trace the current process back to the specified node.

具体的,工作流引擎以当前待办实例作为父类创建子类待办实例,同时重置父类的审批人为指定类型,该类型依据加签类型决定,并设置子类的管理者为父类的审批人,即当前审批人,创建子类的数量取决于审批人加签人数量。子类完成审批后,查询其父类并对其进行处理,具体的处理需依据父类的加签类型进行处理,前加签需将审批人重置为原始审批人后直接返回,后加签则需在前加签的基础上将其审批完成。Specifically, the workflow engine uses the current to-do instance as the parent class to create a sub-class to-do instance, and at the same time resets the approver of the parent class to the specified type, which is determined according to the signature type, and sets the manager of the sub-class as the parent class The number of approved approvers, that is, the current approver, depends on the number of approvers who sign up. After the subclass completes the approval, query its parent class and process it. The specific processing needs to be processed according to the signature type of the parent class. Before adding a signature, you need to reset the approver to the original approver and return directly, and then add a signature. It needs to be approved on the basis of the previous signature.

工作流引擎依据当前审批人获取其最近一次审批过的节点(非流程当前节点),删除当前节点的所有待办实例,最后将当前流程回溯到指定节点。The workflow engine obtains the last approved node (not the current node of the process) according to the current approver, deletes all to-do instances of the current node, and finally traces the current process back to the specified node.

本实施中,对相同分类下的流程定义,通过预先配置业务参数组,指定不同业务参数组关联不同的流程定义,以达到启动工作流时,通过业务参数动态选择流程定义并启动工作流。In this implementation, for process definitions under the same classification, by preconfiguring business parameter groups, specifying different business parameter groups to associate with different process definitions, so that when a workflow is started, the process definition can be dynamically selected through the business parameters and the workflow is started.

具体的,针对相同分类下的流程定义(使用同一类型业务单据),通过预先配置业务参数组(参见表1),指定不同的业务参数组关联不同的流程定义,以达到启动工作流时,通过业务参数动态选择流程定义并启动工作流。Specifically, for the process definitions under the same category (using the same type of business documents), pre-configure business parameter groups (see Table 1), and specify different business parameter groups to associate with different process definitions, so that when the workflow is started, the Business parameters dynamically select process definitions and initiate workflows.

序号serial number公司company业务实体business entity采购组Purchasing Group来源系统source system流程process默认流程发起人Default Process Initiator11企业AEnterprise A工厂1Factory 1采购组001Purchasing Group 001SRMSRM流程AProcess A账户aaccount a22企业AEnterprise A工厂1Factory 1////流程BProcess B账户baccount b33//工厂1Factory 1//SRMSRM流程CProcessC账户caccount c44企业AEnterprise A工厂1Factory 1////流程DProcess D账户daccount d55////////流程EProcess E账户daccount d

某笔单据参数与流程A、B、C、D匹配,由于流程A字段值匹配值最多,选择流程A;若存在与流程A不匹配数据时,但与流程B、C、D匹配且匹配的参数数量相同,由于变量【公司】较【业务实体】靠前,因而从流程B、D选择,流程B、D两个优先级均一致,所以随机选择一条;流程E的变量值均为空,为默认流程,其优先级最低,当以上均未匹配时,选择该流程。The parameters of a document match processes A, B, C, and D. Since the field value of process A has the most matching values, process A is selected; if there is data that does not match process A, it matches and matches processes B, C, and D. The number of parameters is the same. Since the variable [company] is higher than [business entity], it is selected from processes B and D. Both processes B and D have the same priority, so one is randomly selected; the variable value of process E is empty, It is the default process with the lowest priority. When none of the above matches, this process is selected.

综上所述,本发明通过在线流程设计器进行流程定义,根据BPMN2.0协议增加扩展节点存储自定义的业务化配置,业务化配置包括审批规则、审批方式、跳转条件和服务调用;预先进行流程表单定义,流程表单包括只读表单和可编辑表单,通过流程表单在审批时展示业务单据详情;通过审批规则在人工节点查找审批人员,通过审批方式判断在是否满足指定条件时离开当前人工节点继续向下流转,通过跳转条件控制流程分支走向,通过服务调用在指定节点远程调用业务模块执行自定义逻辑。通过预先定义邮件模版和渲染邮件模版所需数据的来源,在流程定义的人工节点中选择所需邮件模板,将模版编码保存在人工节点中;当流程启动时,依据模版编码获取邮件模版配置,通过Free marker引擎结合预先定义的数据来源动态渲染邮件内容,最终通过消息服务发送给审批人。根据监听器的执行时期进行消息埋点,在不同时期对不同的审批人发送不同的消息类型。以当前待办实例作为父类创建子类待办实例,重置父类的审批人为指定类型,指定类型依据加签类型决定,加签类型包括前加签和后加签;依据当前审批人获取最近一次审批过的节点,删除当前节点的所有待办实例,将当前流程回溯到指定节点。本发明提升流程启动的高扩展性,基于规则引擎工作流引擎接收业务参数后基于启动流程审批实例,满足实际业务同一租户下不同公司审批流差异性;增强流程引擎的其他服务或外部系统协作性,流程审批支持嵌入定制化的表单,并可使用业务表单中的业务数据配置化控制后续流程流转;运行中支持支持移动端、PC端及邮件审批方式进行处理;通过监听器执行跨服务的任务调度,实现多个微服务的业务协作;降低流程引擎开发难度与代码量,便于需求扩展和协同开发以及维护;用户及实施人员使用配置化,可视化流程图配置、配置图可导出XML文件多环境迁移,及系统内消息提醒或外部消息提醒协作,提升工作流引擎使用便携性与友好性。To sum up, the present invention uses the online process designer to define the process, and adds an extension node according to the BPMN2.0 protocol to store the customized business configuration. The business configuration includes approval rules, approval methods, jump conditions and service calls; Define the process form. The process form includes read-only forms and editable forms. The business document details are displayed during approval through the process form. The approval rules are used to find the approvers in the manual node, and the approval method is used to determine whether to leave the current manual when the specified conditions are met. Nodes continue to flow downward, control the direction of process branches through jump conditions, and remotely call business modules to execute custom logic at specified nodes through service calls. By pre-defining the email template and the source of the data required for rendering the email template, select the required email template in the artificial node of the process definition, and save the template code in the artificial node; when the process starts, obtain the email template configuration according to the template code, The content of the email is dynamically rendered by the Free marker engine combined with the pre-defined data sources, and finally sent to the approver through the message service. Embed messages according to the execution period of the listener, and send different message types to different approvers in different periods. Use the current to-do instance as the parent class to create a sub-class to-do instance, reset the approver of the parent class to the specified type, and the specified type is determined according to the signature type. For the most recently approved node, delete all to-do instances of the current node, and trace the current process back to the specified node. The invention improves the high scalability of process startup, and the workflow engine based on the rule engine receives the business parameters and approves the instance based on the startup process, which satisfies the difference of the approval flow of different companies under the same tenant of the actual business; and enhances the collaboration of other services or external systems of the process engine. , Process approval supports embedding customized forms, and can use the business data in the business form to configure and control the subsequent process flow; support mobile, PC and email approval methods for processing during operation; perform cross-service tasks through listeners Scheduling to realize business collaboration of multiple microservices; reduce the difficulty of process engine development and the amount of code, facilitate demand expansion, collaborative development and maintenance; users and implementers can use configuration, visualize flowchart configuration, and configuration diagrams can export XML files to multiple environments Migration, and collaboration with in-system message reminders or external message reminders, improve the portability and friendliness of the workflow engine.

实施例2Example 2

参见图4,本发明实施例2还提供一种基于微服务SaaS的企业级工作流引擎实现系统,包括:Referring to FIG. 4 ,Embodiment 2 of the present invention further provides an enterprise-level workflow engine implementation system based on micro-service SaaS, including:

流程定义单元1,用于通过在线流程设计器进行流程定义,根据BPMN2.0协议增加扩展节点存储自定义的业务化配置,业务化配置包括审批规则、审批方式、跳转条件和服务调用;Theprocess definition unit 1 is used to define the process through the online process designer, and add an extension node according to the BPMN2.0 protocol to store the customized business configuration. The business configuration includes approval rules, approval methods, jump conditions and service calls;

表单定义单元2,用于预先进行流程表单定义,流程表单包括只读表单和可编辑表单,通过流程表单在审批时展示业务单据详情;Theform definition unit 2 is used to define the process form in advance. The process form includes a read-only form and an editable form, and the business document details are displayed during approval through the process form;

任务处理单元3,用于通过审批规则在人工节点查找审批人员,通过审批方式判断在是否满足指定条件时离开当前人工节点继续向下流转,通过跳转条件控制流程分支走向,通过服务调用在指定节点远程调用业务模块执行自定义逻辑。The task processing unit 3 is used to find the approver at the artificial node through the approval rule, judge whether the specified condition is satisfied by the approval method, and leave the current artificial node and continue to flow downward, control the flow branch direction through the jump condition, and use the service call to specify the The node remotely invokes the business module to execute custom logic.

本实施例中,只读表单通过iframe实现,可编辑表单通过动态路由和异步加载实现跨模块加载页面。In this embodiment, the read-only form is implemented by iframe, and the editable form is implemented by dynamic routing and asynchronous loading to load pages across modules.

本实施例中,流程表单的定义包含表单对应的前端路由;In this embodiment, the definition of the process form includes the front-end route corresponding to the form;

在设计流程图过程,对任意人工节点配置审批表单,将审批表单编码存储到当前节点;In the process of designing the flowchart, configure the approval form for any artificial node, and store the approval form code to the current node;

在审批过程,依据表单编码和流程变量动态解析表单地址。During the approval process, the form address is dynamically resolved according to the form code and process variables.

本实施例中,业务化配置中保存的为服务定义编码,在启动流程时,动态解析流程节点中的服务定义编码;In this embodiment, the service definition code is stored in the business configuration, and when the process is started, the service definition code in the process node is dynamically parsed;

当审批规则不满足业务场景时,通过自定义创建审批规则编写找人逻辑。When the approval rules do not meet the business scenario, you can write the search logic by creating custom approval rules.

本实施例中,还包括邮件审批单元4,用于通过预先定义邮件模版和渲染邮件模版所需数据的来源,在流程定义的人工节点中选择所需邮件模板,将模版编码保存在人工节点中。In this embodiment, anemail approval unit 4 is also included, which is used to select the required email template in the manual node of the process definition by predefining the email template and the source of the data required for rendering the email template, and save the template code in the manual node. .

本实施例中,当流程启动时,依据模版编码获取邮件模版配置,通过Free marker引擎结合预先定义的数据来源动态渲染邮件内容,最终通过消息服务发送给审批人。In this embodiment, when the process starts, the email template configuration is obtained according to the template code, the content of the email is dynamically rendered by the Free marker engine in combination with the predefined data sources, and finally sent to the approver through the message service.

本实施例中,还包括消息提醒单元5,用于根据监听器的执行时期进行消息埋点,在不同时期对不同的审批人发送不同的消息类型。In this embodiment, a message reminding unit 5 is further included, configured to perform message embedding according to the execution period of the listener, and send different message types to different approvers in different periods.

本实施例中,还包括加签单元6,用于以当前待办实例作为父类创建子类待办实例,重置父类的审批人为指定类型,指定类型依据加签类型决定,加签类型包括前加签和后加签;删除当前审批人审批的待办实例,依据加签类型控制流程流转,前加签回溯到原始审批人,后加签依据流程图继续向下流转。In this embodiment, asigning unit 6 is also included, which is used to create a to-do instance of a sub-class with the current to-do instance as a parent class, and reset the approver of the parent class to a designated type. The designated type is determined according to the signing type. Including pre-approval and post-approval; delete the to-do instance approved by the current approver, control the flow of the process according to the type of approval, the pre-approval can be traced back to the original approver, and the post-approval will continue to flow downward according to the flow chart.

本实施例中,还包括撤回单元7,用于依据当前审批人获取最近一次审批过的节点,删除当前节点的所有待办实例,将当前流程回溯到指定节点。In this embodiment, a withdrawingunit 7 is further included, which is used for obtaining the most recently approved node according to the current approver, deleting all to-do instances of the current node, and backtracking the current process to the specified node.

本实施例中,还包括启动处理单元8,用于对相同分类下的流程定义,通过预先配置业务参数组,指定不同业务参数组关联不同的流程定义,以达到启动工作流时,通过业务参数动态选择流程定义并启动工作流。In this embodiment, a startup processing unit 8 is further included, which is used to preconfigure the business parameter groups for the process definitions under the same classification, and designate different business parameter groups to associate with different process definitions, so that when the workflow is started, the business parameter Dynamically select process definitions and start workflows.

需要说明的是,上述系统各模块/单元之间的信息交互、执行过程等内容,由于与本申请实施例1中的方法实施例基于同一构思,其带来的技术效果与本申请方法实施例相同,具体内容可参见本申请前述所示的方法实施例中的叙述,此处不再赘述。It should be noted that the information exchange, execution process and other contents between the modules/units of the above-mentioned system are based on the same concept as the method embodiment inEmbodiment 1 of the present application, and the technical effect brought by the method is the same as that of the method embodiment of the present application. The same, for the specific content, reference may be made to the descriptions in the method embodiments shown above in this application, and details are not repeated here.

实施例3Example 3

本发明实施例3提供一种非暂态计算机可读存储介质,所述计算机可读存储介质中存储有基于微服务SaaS的企业级工作流引擎实现方法的程序代码,所述程序代码包括用于执行实施例1或其任意可能实现方式的基于微服务SaaS的企业级工作流引擎实现方法的指令。Embodiment 3 of the present invention provides a non-transitory computer-readable storage medium, where the computer-readable storage medium stores a program code for an enterprise-level workflow engine implementation method based on a microservice SaaS, and the program code includes an The instructions for implementing the method for implementing the microservice SaaS-based enterprise-level workflow engine ofEmbodiment 1 or any possible implementation manner thereof are executed.

计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质(例如固态硬盘(SolidState Disk、SSD))等。A computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that includes an integration of one or more available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVD), or semiconductor media (eg, Solid State Disk (SSD)), and the like.

实施例4Example 4

本发明实施例4提供一种电子设备,包括:存储器和处理器;Embodiment 4 of the present invention provides an electronic device, including: a memory and a processor;

所述处理器和所述存储器通过总线完成相互间的通信;所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行实施例1或其任意可能实现方式的基于微服务SaaS的企业级工作流引擎实现方法。The processor and the memory communicate with each other through a bus; the memory stores program instructions that can be executed by the processor, and the processor invokes the program instructions to executeEmbodiment 1 or any possibility thereof Implementation method of enterprise-level workflow engine based on microservice SaaS.

具体的,处理器可以通过硬件来实现也可以通过软件来实现,当通过硬件实现时,该处理器可以是逻辑电路、集成电路等;当通过软件来实现时,该处理器可以是一个通用处理器,通过读取存储器中存储的软件代码来实现,该存储器可以集成在处理器中,可以位于所述处理器之外,独立存在。Specifically, the processor can be implemented by hardware or software. When implemented by hardware, the processor can be a logic circuit, an integrated circuit, etc.; when implemented by software, the processor can be a general-purpose processor The processor is realized by reading the software codes stored in the memory, and the memory can be integrated in the processor, and can be located outside the processor and exist independently.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机程序指令时,全部或部分地产生按照本发明实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。In the above-mentioned embodiments, it may be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented in software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server, or data center is by wire (eg, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).

显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above-mentioned modules or steps of the present invention can be implemented by a general-purpose computing device, which can be centralized on a single computing device, or distributed in a network composed of multiple computing devices Alternatively, they may be implemented in program code executable by a computing device, such that they may be stored in a storage device and executed by the computing device, and in some cases, in a different order than here The steps shown or described are performed either by fabricating them separately into individual integrated circuit modules, or by fabricating multiple modules or steps of them into a single integrated circuit module. As such, the present invention is not limited to any particular combination of hardware and software.

虽然,上文中已经用一般性说明及具体实施例对本发明作了详尽的描述,但在本发明基础上,可以对之作一些修改或改进,这对本领域技术人员而言是显而易见的。因此,在不偏离本发明精神的基础上所做的这些修改或改进,均属于本发明要求保护的范围。Although the present invention has been described in detail above with general description and specific embodiments, some modifications or improvements can be made on the basis of the present invention, which will be obvious to those skilled in the art. Therefore, these modifications or improvements made without departing from the spirit of the present invention fall within the scope of the claimed protection of the present invention.

Claims (10)

Translated fromChinese
1.基于微服务SaaS的企业级工作流引擎实现方法,其特征在于,包括:1. An enterprise-level workflow engine implementation method based on microservice SaaS, characterized in that, comprising:通过在线流程设计器进行流程定义,根据BPMN2.0协议增加扩展节点存储自定义的业务化配置,所述业务化配置包括审批规则、审批方式、跳转条件和服务调用;The process is defined by the online process designer, and the expansion node is added according to the BPMN2.0 protocol to store the customized business configuration, and the business configuration includes approval rules, approval methods, jump conditions and service calls;预先进行流程表单定义,所述流程表单包括只读表单和可编辑表单,通过所述流程表单在审批时展示业务单据详情;Define a process form in advance, the process form includes a read-only form and an editable form, and the business document details are displayed during approval through the process form;通过所述审批规则在人工节点查找审批人员,通过所述审批方式判断在是否满足指定条件时离开当前人工节点继续向下流转,通过所述跳转条件控制流程分支走向,通过所述服务调用在指定节点远程调用业务模块执行自定义逻辑。Find the approver at the artificial node through the approval rule, judge whether the specified condition is satisfied by the approval method, and leave the current artificial node and continue to flow downward, control the flow branch direction through the jump condition, and call the service at the The specified node remotely invokes the business module to execute custom logic.2.根据权利要求1所述的基于微服务SaaS的企业级工作流引擎实现方法,其特征在于,所述只读表单通过iframe实现,所述可编辑表单通过动态路由和异步加载实现跨模块加载页面。2. The method for realizing an enterprise-level workflow engine based on microservice SaaS according to claim 1, wherein the read-only form is realized by iframe, and the editable form is loaded through dynamic routing and asynchronous loading to realize cross-module loading page.3.根据权利要求2所述的基于微服务SaaS的企业级工作流引擎实现方法,其特征在于,所述流程表单的定义包含表单对应的前端路由;3. The enterprise-level workflow engine implementation method based on microservice SaaS according to claim 2, wherein the definition of the process form comprises the front-end routing corresponding to the form;在设计流程图过程,对任意人工节点配置审批表单,将审批表单编码存储到当前节点;In the process of designing the flowchart, configure the approval form for any artificial node, and store the approval form code to the current node;在审批过程,依据表单编码和流程变量动态解析表单地址。During the approval process, the form address is dynamically resolved according to the form code and process variables.4.根据权利要求1所述的基于微服务SaaS的企业级工作流引擎实现方法,其特征在于,所述业务化配置中保存的为服务定义编码,在启动流程时,动态解析流程节点中的服务定义编码;4. The enterprise-level workflow engine implementation method based on micro-service SaaS according to claim 1, characterized in that, what is saved in the business configuration is the service definition code, and when starting the process, dynamically parse the process node. service definition code;当所述审批规则不满足业务场景时,通过自定义创建审批规则编写找人逻辑。When the approval rule does not meet the business scenario, the search logic is written by creating an approval rule by definition.5.根据权利要求1所述的基于微服务SaaS的企业级工作流引擎实现方法,其特征在于,还包括,通过预先定义邮件模版和渲染邮件模版所需数据的来源,在流程定义的人工节点中选择所需邮件模板,将模版编码保存在人工节点中;5. the enterprise-level workflow engine implementation method based on microservice SaaS according to claim 1, is characterized in that, also comprises, by pre-defining the source of mail template and rendering the required data of the mail template, in the artificial node of process definition Select the desired email template in the , and save the template code in the artificial node;当流程启动时,依据模版编码获取邮件模版配置,通过Free marker引擎结合预先定义的数据来源动态渲染邮件内容,最终通过消息服务发送给审批人。When the process starts, the email template configuration is obtained according to the template code, and the content of the email is dynamically rendered by the Free marker engine combined with the pre-defined data sources, and finally sent to the approver through the message service.6.根据权利要求5所述的基于微服务SaaS的企业级工作流引擎实现方法,其特征在于,还包括,根据监听器的执行时期进行消息埋点,在不同时期对不同的审批人发送不同的消息类型。6. The enterprise-level workflow engine implementation method based on micro-service SaaS according to claim 5, characterized in that, further comprising, performing message burying according to the execution period of the listener, and sending different messages to different approvers in different periods. message type.7.根据权利要求1所述的基于微服务SaaS的企业级工作流引擎实现方法,其特征在于,以当前待办实例作为父类创建子类待办实例,重置父类的审批人为指定类型,指定类型依据加签类型决定,加签类型包括前加签和后加签;7. The enterprise-level workflow engine implementation method based on micro-service SaaS according to claim 1, wherein the current to-do instance is used as a parent class to create a sub-class to-do instance, and the approver of the parent class is reset to a specified type , the specified type is determined according to the type of signature, and the type of signature includes pre-attachment and post-attachment;删除当前审批人审批的待办实例,依据加签类型控制流程流转,前加签回溯到原始审批人,后加签依据流程图继续向下流转;Delete the to-do instance approved by the current approver, and control the flow of the process according to the type of endorsement. The former endorsement can be traced back to the original approver, and the latter endorsement continues to flow downward according to the flow chart;依据当前审批人获取最近一次审批过的节点,删除当前节点的所有待办实例,将当前流程回溯到指定节点。Obtain the last approved node according to the current approver, delete all to-do instances of the current node, and trace the current process back to the specified node.8.根据权利要求1所述的基于微服务SaaS的企业级工作流引擎实现方法,其特征在于,对相同分类下的流程定义,通过预先配置业务参数组,指定不同业务参数组关联不同的流程定义,以达到启动工作流时,通过业务参数动态选择流程定义并启动工作流。8. The enterprise-level workflow engine implementation method based on micro-service SaaS according to claim 1, characterized in that, for the process definitions under the same classification, by pre-configuring business parameter groups, specifying different business parameter groups to associate with different processes Definition, so that when the workflow is started, the process definition is dynamically selected through business parameters and the workflow is started.9.基于微服务SaaS的企业级工作流引擎实现系统,其特征在于,包括:9. An enterprise-level workflow engine implementation system based on micro-service SaaS, characterized in that it includes:流程定义单元,用于通过在线流程设计器进行流程定义,根据BPMN2.0协议增加扩展节点存储自定义的业务化配置,所述业务化配置包括审批规则、审批方式、跳转条件和服务调用;The process definition unit is used to define the process through the online process designer, and add an extension node according to the BPMN2.0 protocol to store a customized business configuration, and the business configuration includes approval rules, approval methods, jump conditions and service calls;表单定义单元,用于预先进行流程表单定义,所述流程表单包括只读表单和可编辑表单,通过所述流程表单在审批时展示业务单据详情;The form definition unit is used to define a process form in advance, the process form includes a read-only form and an editable form, and the business document details are displayed during approval through the process form;任务处理单元,用于通过所述审批规则在人工节点查找审批人员,通过所述审批方式判断在是否满足指定条件时离开当前人工节点继续向下流转,通过所述跳转条件控制流程分支走向,通过所述服务调用在指定节点远程调用业务模块执行自定义逻辑。a task processing unit, configured to search for an approver at an artificial node through the approval rule, determine whether to leave the current artificial node and continue to flow downward through the approval method when a specified condition is met, and control the flow branch direction through the jump condition, Through the service invocation, the business module is remotely invoked at the specified node to execute the custom logic.10.根据权利要求9所述的基于微服务SaaS的企业级工作流引擎实现系统,其特征在于,所述只读表单通过iframe实现,所述可编辑表单通过动态路由和异步加载实现跨模块加载页面;10. The enterprise-level workflow engine implementation system based on microservice SaaS according to claim 9, wherein the read-only form is realized by iframe, and the editable form is loaded through dynamic routing and asynchronous loading to realize cross-module loading page;所述流程表单的定义包含表单对应的前端路由;The definition of the process form includes the front-end route corresponding to the form;在设计流程图过程,对任意人工节点配置审批表单,将审批表单编码存储到当前节点;In the process of designing the flowchart, configure the approval form for any artificial node, and store the approval form code to the current node;在审批过程,依据表单编码和流程变量动态解析表单地址;In the approval process, dynamically resolve the form address according to the form code and process variables;所述业务化配置中保存的为服务定义编码,在启动流程时,动态解析流程节点中的服务定义编码;The service definition code is stored in the business configuration, and when the process is started, the service definition code in the process node is dynamically parsed;当所述审批规则不满足业务场景时,通过自定义创建审批规则编写找人逻辑;When the approval rule does not meet the business scenario, write the search logic by customizing the creation of the approval rule;还包括邮件审批单元,用于通过预先定义邮件模版和渲染邮件模版所需数据的来源,在流程定义的人工节点中选择所需邮件模板,将模版编码保存在人工节点中;It also includes an email approval unit, which is used to select the required email template in the manual node of the process definition by predefining the email template and the source of the data required for rendering the email template, and save the template code in the manual node;当流程启动时,依据模版编码获取邮件模版配置,通过Free marker引擎结合预先定义的数据来源动态渲染邮件内容,最终通过消息服务发送给审批人;When the process starts, the email template configuration is obtained according to the template code, and the content of the email is dynamically rendered by the Free marker engine combined with the pre-defined data sources, and finally sent to the approver through the message service;还包括消息提醒单元,用于根据监听器的执行时期进行消息埋点,在不同时期对不同的审批人发送不同的消息类型;It also includes a message reminder unit, which is used for message embedding according to the execution period of the listener, and sends different message types to different approvers in different periods;还包括加签单元,用于以当前待办实例作为父类创建子类待办实例,重置父类的审批人为指定类型,指定类型依据加签类型决定,加签类型包括前加签和后加签;删除当前审批人审批的待办实例,依据加签类型控制流程流转,前加签回溯到原始审批人,后加签依据流程图继续向下流转;It also includes a signature unit, which is used to create a subclass to-do instance with the current to-do instance as the parent class, and reset the approver of the parent class to the specified type. The specified type is determined according to the signature type. Add signature; delete the to-do instance approved by the current approver, control the flow of the process according to the type of signature, the former signature can be traced back to the original approver, and the latter signature will continue to flow downward according to the flow chart;还包括撤回单元,用于依据当前审批人获取最近一次审批过的节点,删除当前节点的所有待办实例,将当前流程回溯到指定节点;It also includes a withdrawal unit, which is used to obtain the last approved node according to the current approver, delete all to-do instances of the current node, and trace the current process back to the specified node;还包括启动处理单元,用于对相同分类下的流程定义,通过预先配置业务参数组,指定不同业务参数组关联不同的流程定义,以达到启动工作流时,通过业务参数动态选择流程定义并启动工作流。It also includes a startup processing unit, which is used to define the process under the same classification, by pre-configuring the business parameter group, and specifying different business parameter groups to associate with different process definitions, so that when the workflow is started, the process definition can be dynamically selected and started by the business parameters. Workflow.
CN202111556056.1A2021-12-172021-12-17 Enterprise-level workflow engine implementation method and system based on microservice SaaSActiveCN114493479B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111556056.1ACN114493479B (en)2021-12-172021-12-17 Enterprise-level workflow engine implementation method and system based on microservice SaaS

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111556056.1ACN114493479B (en)2021-12-172021-12-17 Enterprise-level workflow engine implementation method and system based on microservice SaaS

Publications (2)

Publication NumberPublication Date
CN114493479Atrue CN114493479A (en)2022-05-13
CN114493479B CN114493479B (en)2025-05-02

Family

ID=81494820

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111556056.1AActiveCN114493479B (en)2021-12-172021-12-17 Enterprise-level workflow engine implementation method and system based on microservice SaaS

Country Status (1)

CountryLink
CN (1)CN114493479B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114924786A (en)*2022-06-062022-08-19珠海格力电器股份有限公司Method, system and storage medium for dynamic configuration of process state
CN115080369A (en)*2022-05-312022-09-20安徽同徽信息技术有限公司Method for realizing automation of supply chain process
CN115292022A (en)*2022-09-292022-11-04泰豪软件股份有限公司Workflow engine system, implementation method, storage medium and computer equipment
CN115396511A (en)*2022-08-242022-11-25数字浙江技术运营有限公司 Multi-tenant process engine creation, application method and system
CN115713301A (en)*2022-11-092023-02-24中国铁建高新装备股份有限公司Equipment maintenance method, system and storage medium
CN115759372A (en)*2022-11-082023-03-07普联软件股份有限公司Process engine optimization method and system based on business processing and process driving decoupling
CN115964055A (en)*2022-12-282023-04-14中锦技术(广东)有限公司 A conversion control system between workflow engine and rule engine
CN117372177A (en)*2023-10-132024-01-09国任财产保险股份有限公司Novel non-vehicle underwriting core system
CN117973828A (en)*2024-03-282024-05-03北京首信科技股份有限公司Approval process management method and device for business general purpose based on Activiti
CN118396547A (en)*2024-04-222024-07-26吉林大学 A process engine system based on personnel system and its file management method

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102147880A (en)*2010-02-092011-08-10新奥特(北京)视频技术有限公司Independent news manuscript system and workflow engine therefor
CN105989440A (en)*2015-02-122016-10-05杨波Process customization processing method and workflow engine thereof
CN106293915A (en)*2016-08-042017-01-04南京唯实科技有限公司Job engine method based on activiti5
CN106779619A (en)*2016-12-302017-05-31全民互联科技(天津)有限公司A kind of examination & verification for improving business approval is endorsed method and system
CN113159705A (en)*2021-03-092021-07-23浪潮云信息技术股份公司Method for realizing approval process under government affair cloud scene
CN113312181A (en)*2021-06-212021-08-27浪潮云信息技术股份公司High-concurrency workflow approval method based on activiti custom form

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102147880A (en)*2010-02-092011-08-10新奥特(北京)视频技术有限公司Independent news manuscript system and workflow engine therefor
CN105989440A (en)*2015-02-122016-10-05杨波Process customization processing method and workflow engine thereof
CN106293915A (en)*2016-08-042017-01-04南京唯实科技有限公司Job engine method based on activiti5
CN106779619A (en)*2016-12-302017-05-31全民互联科技(天津)有限公司A kind of examination & verification for improving business approval is endorsed method and system
CN113159705A (en)*2021-03-092021-07-23浪潮云信息技术股份公司Method for realizing approval process under government affair cloud scene
CN113312181A (en)*2021-06-212021-08-27浪潮云信息技术股份公司High-concurrency workflow approval method based on activiti custom form

Cited By (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115080369A (en)*2022-05-312022-09-20安徽同徽信息技术有限公司Method for realizing automation of supply chain process
CN115080369B (en)*2022-05-312025-04-08安徽同徽信息技术有限公司Automatic realization method for supply chain process
CN114924786A (en)*2022-06-062022-08-19珠海格力电器股份有限公司Method, system and storage medium for dynamic configuration of process state
CN115396511A (en)*2022-08-242022-11-25数字浙江技术运营有限公司 Multi-tenant process engine creation, application method and system
CN115292022A (en)*2022-09-292022-11-04泰豪软件股份有限公司Workflow engine system, implementation method, storage medium and computer equipment
CN115759372A (en)*2022-11-082023-03-07普联软件股份有限公司Process engine optimization method and system based on business processing and process driving decoupling
CN115713301A (en)*2022-11-092023-02-24中国铁建高新装备股份有限公司Equipment maintenance method, system and storage medium
CN115964055A (en)*2022-12-282023-04-14中锦技术(广东)有限公司 A conversion control system between workflow engine and rule engine
CN117372177A (en)*2023-10-132024-01-09国任财产保险股份有限公司Novel non-vehicle underwriting core system
CN117973828A (en)*2024-03-282024-05-03北京首信科技股份有限公司Approval process management method and device for business general purpose based on Activiti
CN118396547A (en)*2024-04-222024-07-26吉林大学 A process engine system based on personnel system and its file management method

Also Published As

Publication numberPublication date
CN114493479B (en)2025-05-02

Similar Documents

PublicationPublication DateTitle
CN114493479A (en) Implementation method and system of enterprise-level workflow engine based on microservice SaaS
US9268538B2 (en)Metadata driven user interface system and method
CN113692582B (en)User interface for establishing a data privacy pipeline and contract agreement to share data
US9501267B2 (en)Generating a service component architecture (SCA) module with service oriented architecture (SOA) model elements
US20100107165A1 (en)Method, system, and apparatus for process management
AU2011305494B2 (en)Methods and apparatus for dynamic endpoint generators and dynamic remote object discovery and brokerage
CN111507689B (en)Service processing method, device, equipment and computer readable storage medium
US20100106551A1 (en)Method, system, and apparatus for process management
CN112116516B (en) Method and device for uniformly processing multiple types of government affairs
WO2010046526A1 (en)Method, system, and apparatus for process management
CN115061674A (en) A method, device, system and readable storage medium for online orchestration of business processes
US20130067456A1 (en)Application configuration framework for enterprise resource planning application installation
Mejia Bernal et al.Dynamic context-aware business process: a rule-based approach supported by pattern identification
US20240111741A1 (en)Placeholder case nodes and child case nodes in a case model
CN114201718A (en) Dynamically configurable form instance generation method and device
CN108074074A (en)Integration device and integration method thereof
US8468159B2 (en)Data element categorization in a service-oriented architecture
US9286578B2 (en)Determination of a most suitable address for a master data object instance
CN118195513A (en) Process configuration method, device and storage medium
CN117874384A (en) Site content publishing management method, device, computer equipment and storage medium
US20190378090A1 (en)System for social versioning
US20130046840A1 (en)System and method for dynamically generating an email message
CN114356328A (en) Method, system and computer storage medium for fast adaptation of enterprise portal
Snyder et al.Working with Microsoft Dynamics CRM 3.0
JP2015132913A (en) Report creation system

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp