views:

87

answers:

2

I'm in the process of buidling a few ASP.NET webforms that need to support approvals. The approvals would be done based on a org chart, probably represented as a tree. I've been thinking the approval routing (process of determining who soemthing should be routed to) should be seperate from the actions being performed. This would allow me to use the same approval routing for multiple soltuions. Does this make sense??? Is there anything like this that exists in open source with .NET, that I could look at for consideration on how I should implement/design this?

Here is an example of what I want to do:

A new purchase order is created and it needs to be approved, the first buiness rule A requires 2 higher levels of authorization before performing business rule B.

Employee --> Supervisior --> Department Manager

I'm thinking I would pass the user to the approval routing service, but I'm not sure what I should get back. I think I should give back the full route incase updates are made to org chart/tree after submission.

Example:

The employee making the request is in CS ("Customer Service") during the entire request . ** CS Employee --> CS Supervisior --> CS Department Manager

The employee moves to sales department during the request. ** SALES Employee --> SALES Supervisior --> SALES Department Manager

Since things get mixxed up because the user moves departments, this is why I think the entire route should be saved. Logical? I don't think employee changes will be very common, but I want to make sure I'm applying best practice up front... most logical soltuion up front before injecting exceptions.

Any feedback/ideas on the design would greatly be appreicated, if something exists that implements this type of soltuion I'd love to hear about it as well as any feedback on people's past experience trying to do something homegrown. It seems pretty straight forward, but before I coding I'd like to see what others think... I'm sure there are some KEY things I've not thought about.

The programming technology I'm using on this project is IIS 7.0, VS2008, .NET 3.5 and C#.

Thanks!

+2  A: 

Have you looked at using Windows Workflow to control your routing? Doing a quick search on "WF ASP.NET" shows a lot of information on doing this to control navigation, etc. That may be your best option.

Scott Dorman
A: 

Controlling workflow for things like an approval process, or any business process that may change in the future is exactly what Windows Workflow is all about, I second Scott's suggestion. (made this a wiki answer because I am just echo-ing Scotts answer and giving a link.)

Getting started guide is here

Tim Jarvis