Mar 1, 2007 at 1:25 PM
Edited Mar 1, 2007 at 1:42 PM
Note: This was first created as an issue (http://www.codeplex.com/LitwareHR/WorkItem/View.aspx?WorkItemId=659) and then added as a discussion by user aschapiro.
Does State Machine workflow Support adding activities dynamically like you are doing for Sequential workflow?
Actually, we are using a technique called “XAML activation” in order to start the workflows based on xaml code edited by the user through the workflow editor and then stored in the TenantMetadataStore Database.
This starting of a workflow is based on a xml reader that brings the definition of that workflow. That xaml definition extends a defined workflow type, "EvaluationProcess", which has the workflow code implementation (event handlers, properties, etc.). This
way we let the tenant organize the structure of his evaluation process, leaving the code that will handle it in the base class.
XAML Activation for State Machine workflows
You can start State machine workflows with XAML Activation too. State machine workflows are more suitable to model processes that can pass over the same steps more than once. For that processes, the logic in a sequential workflow would be more complicated.
Why we use sequential workflows and not state machines to model configurable business processes?
One of the things that we avoided by just letting the tenant to organize the "steps" of his sequential process, and that can happen in state machine workflows, is the possibility to have "loops", which could impact performance or stability.
What do you think ?
You will find more XAML activation information in
Tom Lake's blog
, specially the
"Using XAML activation in ASP.NET with a StateMachineWorkflow" post where you can download sample code.
You can take a look at the
Windows Workflow forums for more information.