对于建议的工作流系统的持久战略 [英] Suggest a persistent strategy for a workflow system

查看:223
本文介绍了对于建议的工作流系统的持久战略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在创造我的宠物项目UI配置工具的进程。这个工具的一个方面可以让最终用户定义自己的业务流程。那么我就需要这个业务流程定义保存到数据库中。会有这个定义在运行系统中的可执行版本。可执行版本是动态创建的点播。

想法是分开的定义 EXECUTABLE 版本,这样我可以灵活地选择BPMN或JPDL或基于POJO工作流解决方案中的运行时版本(BeanFlow)

限制:我wan't用我自己的UI特定于我的域名,我不能使用自带了jBPM的,Activiti的等框架BPMN编辑

我需要如何坚持定义的建议。


  1. 我应该使用RDBMS表?如果是这样,有一个DB模式,我可以借是接近编排概念?


  2. 我应该序列我定义BPMN / JPDL XML实例文档?


  3. 还有没有其他简单的格式,我可以使用?



解决方案

通过编排我假设你的意思是的有限状态机。当目前的状态决定什么转变可以跟随其他国家。状态和转换的重新presentation边缘和顶点通常会产生向无环图一个,然而有些时候,图形将周期(如草案 - 报批 - >等待批准 - 拒绝 - >草案)。

在实践中,从执行分离的定义要求一个持久格式,可以轻松容纳定制。当你的系统的发展,你会发现一些意料之外的边缘情况的解决方案不应该要求修改一个持久性方案,只有code。这意味着XML或NoSQL的解决方案 - 这是它的架构很容易地改变或不存在。

现在,编写自己的XML定义为此(为无趣的原因,我会排除),我的建议是使用JPDL(或BPMN)。原因是他们的定义可能包含无论你现在正在考虑,将在未来,并启用定制 - 如在给定点挂任意数据或行为了他们。您还可以得到的已建成的工具的优势 - 不仅仅是用户界面 - 与循环检测处理,并确保没有完成,例如路径

一些我知道JPDL拥有有趣的功能是帮助合并派生进程,定时任务(包括周期性重复),和设施发送通知的能力。这最后一个项目 - 通知 - 具有一些进一步的阐述。一个我用我自己的系统中找到的东西是发送电子邮件配置其内容是基于流经数据的需要。这些现有的引擎做出相对提供了一种插件实例变量成的,然后在运行时在传输之前动态评估文本容易。此外,他们提供引擎以及任何用户存储之间的桥梁发送通知的人群,他们的任务和实施安全政策的目的。

最后,根据系统的范围,你可能仍然会使用一个数据库为好。我的建议是存储关闭XML和数据被编排到一个序列化格式的数据库。然后,如果数据正在被改变的,因为它穿过执行,写出来的数据的序列化 - 或许工作流程,如果它也被改变。 - 成历史/审计日志表,以及

I am in the process of creating a UI configuration tool for my pet project. One aspect of this tool lets the end user DEFINE his orchestration. I then need to save this orchestration definition into a database. There will be a executable version of this definition in a running system. The executable version is created dynamically on-demand.

Idea is to separate the DEFINITION from EXECUTABLE version so that I have the flexibility to choose the runtime version among BPMN or JPDL or a POJO based workflow solution (BeanFlow).

Limitation: I can't use the BPMN editors that come with frameworks like jBPM, Activiti etc as I wan't to use my own UI that is specific to my domain.

I need suggestions on HOW to PERSIST the definition.

  1. Should I use rdbms tables? If so, is there a db schema I can borrow that is close to orchestration concepts?

  2. Should I serialize my definition to BPMN/JPDL XML instance document?

  3. Are there any other simple formats that I can use?

解决方案

By "orchestration" I'm assuming you mean a finite state machine. Where the current state dictates what transitions can be followed to other states. The representation of states and transitions as edges and vertices often produces a directed acyclic graph, however there are times when the graph will cycle (e.g. draft -- submit for approval --> pending approval -- reject --> draft).

In practice, separating the definition from execution calls for a persistence format that can easily accommodate customization. As your system evolves you will find a number of unanticipated edge cases whose solution should not require altering a persistence schema, only code. This implies XML or a NoSQL solution - something whose schema is easily changed or non existent.

Now, having written my own XML definition for this purpose (for uninteresting reasons I'll exclude), my suggestion is using JPDL (or BPMN). Reason is their definitions likely incorporate whatever you're considering now, will in the future, and enable customization - such as hanging arbitrary data or behavior off them at a given point. You also get the advantage of tools already built - not just UI - for dealing with cycle detection and ensuring there is a path to completion for example.

Some of the interesting features I know JPDL possesses are an ability to help merge forked processes, timed tasks (including those that repeat periodically), and facilities for sending notification. This last item - notification - bears some further exposition. One of the things I've found with my own system is the need for sending out configurable email whose content is based on the data flowing through. These existing engines make that relatively easy by providing a way to plugin variables for instance into text that's then dynamically evaluated at run time before transmission. Also they provide bridges between the engine and whatever user store for the purpose of sending notifications to groups of people, tasking them and enforcing security policy.

Finally, depending on the scope of your system, you will probably still be using a database as well. What I suggest is storing off the XML and data being orchestrated into the database in a serialized format. Then, if the data is being altered as it travels through the execution, write out serializations of the data - and perhaps workflow if it is also changed - into a history/audit log table as well.

这篇关于对于建议的工作流系统的持久战略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆