有关如何处理动态数量的“任务"的建议 [英] Advice on How to Process A Dynamic Number of 'Tasks'

查看:57
本文介绍了有关如何处理动态数量的“任务"的建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,

在寻找最佳方法来解决我需要解决的问题时,我遇到了挑战,希望能得到一些指导.

I am having challenges in finding the best approach for the problem I need to solve and would appreciate some guidance.

我有一个动态列表(可以是1或100或...),其中包含按顺序处理.根据任务的类型,每个任务将具有不同的工作流程 它需要经历,并且可能有几个需要暂停执行并等待用户批准的地方.处理整个列表的程序将需要等待处理下一个任务,直到当前任务处于完成状态(这也是 未知的时间).因此,换句话说,我需要某种长时间运行的服务,该服务可以按顺序处理任务.

I have a dynamic list (could be 1  or 100 or ...) of 'tasks' (you can think of a task as something someone needs to act upon in the system) which needs to be processed sequentially. Each task, based on it's type will have a different workflow it needs to go through and may have several points where it needs to pause execution and wait for user approval. The program that processes the whole list will need to wait to process the next task until the current task is in a finished state (which is also an unknown amount of time). So, in other words, I need some sort of long running service that processes tasks sequentially.

我将其发布在这里是因为Windows Workflow(4)似乎是一个显而易见的选择.但是,没有太多示例,如何实现此目标似乎有很多选择.我研究了将整个流程托管在一个工作流程中的方法(例如,在WCF中) 工作流),我研究了以不同的方式分解其自身工作流中的每个任务的方法,但这种方法到目前为止还不清楚.

I am posting this here because Windows Workflow (4) seems to be an obvious choice. However, there seems to be so many options with how to achieve this without many examples. I have looked at ways to host the whole process in one workflow (e.g. inside a WCF workflow) and I have looked at different ways to somehow break out each task in it's own workflow but the way has not become clear as of yet.

任何人都可以提供有关如何完成此操作的任何想法,建议或指导吗?

Can anyone provide any ideas, advice or guidance on how to accomplish this?

我希望我提供了足够的信息.

I hope I have provided enough information.

非常感谢.

凯文·帕金森

加拿大AB省埃德蒙顿

推荐答案

凯文,
听起来您对WF对长时间运行的任务(例如工作流持久性功能)的支持感兴趣.也许还有执行用户定义的任务的能力.

Hi Kevin,
It sounds like you are interested in WF's support for long-running tasks, such as the workflow persistence feature. And maybe the ability to have user-defined tasks.

从您的描述看来,任务列表似乎在程序执行过程中发生了变化.因此,将整个任务列表建模为单个工作流程可能不是一个好主意.最好每个人只有一个工作流程 任务.

From your description, it sounds like the list of tasks changes during the execution of your program. For that reason it would probably not be a good idea to model the entire list of tasks as a single workflow. It would be better to have one workflow per task.

我不确定您是否有任何要求阻止您将其实现为控制台应用程序-您是否需要运行工作流即服务提供的WCF功能?
蒂姆(Tim)

I'm not sure if you have any requirement that would prevent you from implementing this as a console app - do you need the WCF functionality that running the workflows as a service provides?
Tim


这篇关于有关如何处理动态数量的“任务"的建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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