它的设计模式是适合这个工作流程的要求?
我有一个要求,凡在我必须从屏幕上执行的一组作业(每个作业可能需要几个小时才能执行),我需要把一些规则,地方执行的作业。它可以重新使用的曲线图presented
I have a requirement where in I have a set of jobs to be executed from the screen (each job could take hours to execute) and I need to put some rules in place to execute those jobs. it can be represented using a graph.
- 每个作业被赋予一个顺序号和作业应该按顺序执行
- 然而有设置的,可以以任何顺序运行的作业和他们每个人可能有自己的一个路径。例如,一旦A和B完成后,D,E,F,可以按任意顺序运行,但可以有喜欢G规则只能运行D完成后,H可以运行E被做了这样的事情之后。
- 有些工作可以如果preceding并行作业的人成功运行。如果作业是A,B,C,D和A,B,C可在任何顺序运行和D可以运行仅当A或B或C就完成了。
- 有些工作只能如果所有的preceding并行作业完成运行。在上述例如可以存在如D规则可运行如果A和B和C都完成
- 有一些检查站,这意味着一旦检查点操作完成,没有previous可以重新运行,包括检查点的工作。
不知何故,我需要能够给前preSS针对其可以在运行时进行评估工作的条件。像E =(A和B)或(C和D);这意味着就业机会的E能运行,如果A和B是成功还是C和D是成功的。
somehow I need to be able to express a condition against a job which can be evaluated at runtime. something like E = (A and B) OR (C and D); which means job E can run if A and B are successful OR C and D are successful.
这pretty总结了很多不同类型的规则,我的问题是,有没有办法,我可以用它来实现这个设计模式?理想情况下,我想坚持这个工作流程数据库和验证作业是否允许运行或不基于这一点。 Windows工作流可能是这个矫枉过正,我在寻找简单的解决方案可能不是最好的,但需要较少的时间。
that pretty much summarises different types of rules and my question is, Is there a design pattern that I can use to implement this? Ideally I would like to persist this workflow in database and validate whether a job is allowed to run or not based on that. the windows workflow might be an overkill for this and I am looking for simpler solution that may not be the best, but takes less time.
技术:ASP.NET 3.5,C#3.0,SQL Server 2008中
technology to be used: ASP.NET 3.5, C# 3.0, SQL Server 2008
我解决了这个由树格式存储在表的这些作业依赖和使用递归函数计算它。可能不是最好的,但它的工作原理和配置的。
I solved this by storing these job dependencies in a table in a tree format and evaluating it using a recursive function. may not be the best, but it works and configurable.