具有自定义持久性的工作流程 [英] Workflow with custom persistence

查看:78
本文介绍了具有自定义持久性的工作流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我想实现类似于JIRA的东西,其中第1页。我有一个工作流界面,接收工作项ID,操作和参数
2。工作流程将解释输入,查找相应的工作流程ID并执行该操作。然后状态与基数中的数据一起持续存在(例如,item = 3,state = CONFIRMED等等)。当工作流程恢复时,它应该去读取与该工作项目id相关的特定行

如何实现上述方案?我发现SqlPersistentService等似乎以二进制格式保存数据,这使得难以维护经常变化的工作流。另一方面,GUID似乎不是我的工作流程的良好标识符。我宁愿使用workitem ID。有没有办法在不单独维护数据库中的映射的情况下执行此操作?

Let's say I would like to implement something similar to JIRA where
1. I have a workflow interface that receive work item ID, action, and parameters
2. Workflow will interpret the input, look up for the appropriate workflow ID and execute that action
3. The state then get persisted along with the data in a row in the base (for example, item = 3, state = CONFIRMED, etc...)
4. When a workflow is resumed, it should go and read the particular row related to that work item id

How can I achieved above scenario? I found SqlPersistentService etc. seems to persist data in binary format making it difficult to maintain workflow that changes very often. On the other note, GUID seems not to be a good identifier for my workflow. I'd rather use workitem ID. Is there a way to do that without maintaining the mapping in the database separately?

推荐答案

GUID是每个工作流的默​​认标识符。即使您实现了自定义持久性服务,也需要恢复工作流的GUID。

4。要实现上述方案,您可以在工作流中声明一个变量来保存最后一个工作项ID。现在,当您的工作流程恢复时,它将适用于上次创建的工作项。
GUID is the default identifier for each workflow. Even if you implement a custom persistence service, you need the GUID of the workflow to resume.

4. To achieve the above scenario, you can declare a variable in workflow to hold last work item id. now when your workflow will resume, it will work on the work item last created.


这篇关于具有自定义持久性的工作流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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