Ehsan Mohsenpourian
Ehsan Mohsenpourian

Reputation: 41

wcf workflow with parallel sub flows complex scenario

Workflow Scenario

According to attached Scenario we have a workflow:

  1. First user start request and get RequestId and assign request to manager inbox.
  2. Manager see the request and select relevant approvers(1..n) and assign flow to them.
  3. Foreach approver that see the request, Approver can reject and return request to manager or accept and select relevant employees to do something.(the approval process is parallel).
  4. Every employee that receives the work may do and finish the the assigned work.
  5. if all employes finished their assigned works workflow is completed.

in this scenario we have some difficulties:

  1. Workflow in the same time may be in different states(aprovers state and employees state. Approver(1) may assign flow to its employees but approver(2) may do not anything yet).
  2. WCF Operation names in parallel foreach make duplicated bookmarks.

i need best solution or simple example that help me to implement this Scenario. (make sub workflow for approver and employees?,how to solve parallelism problems? use of external wcf flows?)

Upvotes: 0

Views: 127

Answers (1)

Pieter21
Pieter21

Reputation: 1845

Take your data design into account and have the data include state like 'ForApproval', 'Rejected', 'Approved(By)' and optional approver. Be transactional on your data and break workflows if transactions fail. E.g. Rejected can't be Approved, and vice versa.

If on one parallel branch you have an approver that rejects, and on another branch another approver approves, let the first transaction win and break the losing workflow.

You can/must decide if approvers can assign work from another approver. Etc.

Upvotes: 0

Related Questions