Recommend a design pattern for a workflow application

本小妞迷上赌 提交于 2020-01-03 07:00:18

问题


I am developing an application where the users can execute tasks / workflows. Each task is made up of a queue of actions to be executed. I want to be able to be able to have user input after the workflow is started.

Example:

  • Task starts
    • Action1 starts
    • Action1 ends
    • Action2 starts
    • Action2 ends
    • Action3 needs user input (UI opens window to get user input)
    • Action3 gets user input
    • Action3 starts
    • Action3 ends
  • Task ends

I am developing this i C# and I am aware of Workflow Foundation and tasks in C#. They may have what I need, but I am also interested in hearing about a design pattern for doing this from scratch.


回答1:


What you have described is the Sequence Workflow Pattern.

There are more Workflow Patterns at the Workflow Patterns initiative and in MSDN Magazine.




回答2:


I think the following articles can help you with the async task part:

The Task-based Asynchronous Pattern

TPL and Traditional .NET Asynchronous Programming



来源:https://stackoverflow.com/questions/8613905/recommend-a-design-pattern-for-a-workflow-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!