通知系统建模
我正在尝试对一个通知系统进行建模,其中在某个时间段(开始日期和结束日期)内发生事件。如果超过该时间段,则要求用户更新该时间段或设置事件已 i) 取消、ii) 完成或 iii) 关闭的标志。如果今天比活动的预定完成日期晚了一天,则会向经理发送电子邮件。如果是两天,经理及其主管会收到电子邮件。如果>两天后,经理、他们的主管和公司老板都收到了电子邮件。此后每天都会向他们三人发送电子邮件,告知该活动已逾期。事件可以安排在未来的任何时间,因此流程需要简单地跟踪事件何时处于待处理、活动、拖欠(超过结束日期)、取消、关闭或完成。
我已开始将工作流构建为托管在 Windows Server AppFabric 中的 WorkFlow Service 应用程序,因为这似乎是保留此长时间运行的工作流的最佳方式。我还开始使用 WF 状态机活动包 CTP 1,因为它似乎是对这些不同事件状态进行建模的最佳方法。
我不确定如何对该过程进行建模,以及如何让该过程持续存在并继续在后台运行以监视事件的状态和行为,如上面所述。我想我已经在状态机中正确建模了所有状态。我仍在尝试找出从一种状态到另一种状态的过渡任何指导都值得赞赏。
I am trying to model a notification system where an event occurs during a time period (start date and end date). If the time period has been exceeded, the user is required to either update the time period or set a flag that the event has been i) cancelled, ii) completed, or iii) closed. If today is one day past the event's scheduled completion date, the manager is emailed. If two days, the manager and their supervisor is emailed. If > two days, the manager, their supervisor, and the company owner is emailed. Every day after that it emails the three of them that the event is delinquent. Events can be scheduled any time in the future so the process needs to simply track when the event is Pending, Active, Delinquent (past the end date), Cancelled, Closed, or Complete.
I have started building workflow as a WorkFlow Service application hosted in Windows Server AppFabric because it appears that that is the best way to persist this long-running workflow. I have also started using the WF State Machine Activity Pack CTP 1 as it seemed the best way to model these different event states.
I am uncertain how to model this process as well as get the process to persist and continue running in the background to monitor the event's state and behave as outlined above. I think I have all the states modeled correctly in the state machine. I am still trying to figure out the transitions from one state to another Any guidance is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
状态机以突发执行方式运行。当工作流程持续存在时,实际上没有什么可以“运行”。我怀疑你的意思是当超过超时时工作流程将如何“唤醒”。
答案是Delay活动将创建一个持久的计时器。 AppFabric 工作流管理服务定期询问持久层是否有可运行的工作流实例 - 即已崩溃或持久计时器已过期的实例。
最终,计时器将到期,工作流程将被加载,延迟活动书签将被恢复。
State Machines run in a burst of execution. There is really nothing to "run" while the workflow is persisted. I suspect what you mean is how will the workflow "wake up" when the timeout is exceeded.
The answer is that the Delay activity will create a durable timer. The AppFabric Workflow Management service periodically asks the persistence layer if there are runnable workflow instances - that is instances which have crashed or where a durable timer has expired.
Eventually the timer will be expired and the Workflow will be loaded and the Delay activity bookmark will be resumed.