XOML + code workflow from database

Aug 13, 2008 at 4:29 PM
I am creating an application that I want to have a very flexible workflow setup.  Take the example of a Budget Approval workflow.  The template, which is specific to a company, holds the general flow and code, for things like 'wait 7 days then send email reminder', or 'if amount is >100K set next approver as CFO.'  There is a table which stores a list of approvers for each employee.  When the workflow is invoked, I need a dynamic workflow to be built, using the template for the company (stored in a database), and then injecting an approval activity for each approver.

I initially thought I would create a custom activity GetNextApprover, that would look to see if there were any more approvers in the table list.  However, I prefer the approach of injecting an activity for each approver into the workflow.  I can store xoml in the database, and upon workflow submission, deserialize the xoml, inject my own activities, and initialize the resulting workflow.  But this only works for pure xoml workflows, however I need code in the workflow.  It seems like Litware may have achieved this, by somehow deriving from a RecruitingProcess class.  I've read this post: http://www.codeplex.com/LitwareHR/Thread/View.aspx?ThreadId=9391.  Can you provide more guidance of how I can build my app?  Once difference between Litware and my case, is that the base template for Litware is in the filesystem, whereas I would need the base template to be stored in the database and specific to a company.

Thanks for the help.