Search code examples
c#workflowworkflow-foundation-4workflow-foundation

Where to write the eligibility criteria for a workflow in Microsoft WorkFlow foundation


I got some brief idea about Microsoft's workflow foundation. My Application's scenario demand me numerous workflows to process the requests. The requests can be handled by more than one workflow and the right workflow has to be identified based on the requestor and other request information.

Where can I define the filter. Should I define a master workflow which branches the right workflow. or is there any simple way like eligibility criteria for a workflow.


Solution

  • Sure, if the criteria decision makes sense to maintain in one place, have a single workflow get launched with the input data, and branch to the appropriate sub workflow with a simple If activity, or FlowDecision depending on whether you start with a sequence or flowchart. If you have a number of them, i.e. more than a few, a simple If activity might be awkward to use so then you could use a FlowSwitch instead. Another option if the decision logic is more complicated might be to use a Pick, and then "ask" each of the possible sub workflows to say if they can handle the inputs or not.