title: which design pattern is suitable for this workflow requirement?
body: <p>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.</p>
  
  <ol>
  <li>each job is given a sequence number and jobs should be executed in sequence</li>
  <li>however there are set of jobs that can be run in any order and each of them may have a path of their own. for example once A and B are finished, D, E, F can be run in any order, but there can be a rule like G can run only after D is done, H can run only after E is done something like that.</li>
  <li>some jobs can be run if anyone of its preceding parallel jobs is successful. if the jobs are A, B, C, D and A, B, C can be run in any order and D can be run only if A or B or C is completed. </li>
  <li>some jobs can be run only if all of the preceding parallel jobs are completed. in the above for example there can be a rule like D can be run if A and B and C are completed</li>
  <li>there are some checkpoints which means once the checkpoint job is completed, none of the previous can be rerun including the checkpoint job.</li>
  </ol>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>technology to be used: ASP.NET 3.5, C# 3.0, SQL Server 2008</p>