index > Windows Workflow Foundation > Dynamic Updates/ApplyWorkflowChanges and Performance issues

Dynamic Updates/ApplyWorkflowChanges and Performance issues


We are using dynamic updates and we are experiencing some performance issues. Basically we have workflow templates with hooks, wich are extensibility points to inject before we run the workflow. When we receive a message, we inspect it, and the handler decide what template to use to serve this message. Then, we read a configuration file to get the activities to inject in the template workflow. After hooks injection we start the workflow.

The code we are using to do the dynamic updates is something like this


private static void InjectHooks(WorkflowInstance workflowInstance, MasterWorkflowElement masterConfiguration,
WorkflowElement workflowConfiguration)
{
Activity workflowRoot = workflowInstance.GetWorkflowDefinition();
WorkflowChanges workflowChanges = new WorkflowChanges(workflowRoot);
CompositeActivity transientWorkflow = workflowChanges.TransientWorkflow;

foreach (NamedConfigurationElement registeredHook in masterConfiguration.RegisteredHooks)
{
SequenceActivity hook = transientWorkflow.GetActivityByName(registeredHook.Name) as SequenceActivity;
Debug.Assert(hook != null, "hooks is null");

InjectedHookElement hookToInject = workflowConfiguration.HooksToInject.Get(registeredHook.Name);
if (hookToInject != null)
{
Activity hookActivity = (Activity) Activator.CreateInstance(
Type.GetType(hookToInject.HookTypeName), true) ;
Debug.Assert(hookActivity != null, "hookActivity is null");
hook.Activities.Add(hookActivity);
}
}

workflowInstance.ApplyWorkflowChanges(workflowChanges);
}


We are profiling our application using VSTS profiler instrumentation method. 10% (% Elapsed Inclusive Time) of the time is spent in the method ApplyWorkflowChanges.

The main question is if there something wrong with the design we choosed. Is there a way to have a kind of a prepared workflow, cache it, and clone it when the message arrives? Any ideas?

Thanks in advance

BFC

We already did some optimizations in our system. However we continue with the performance problem of the dynamic updates. Now the % Elapsed Inclusive Time increases to 45% (due to optimizations on the other parts of the system). This means that in every request we double the response time due off dynamic updates. We already know that dynamic updates are bad but we will apreciate some help in design alternatives to dynamic updates. We will release the 1st version of our system this month.

Please Help.

Thanks in advance

BFC
reply 2

You can use google to search for other answers

 

More Articles

• Serialize and deserialize a workflow with RuleConditionReference ...
• State Machnine workflows and Correlation Parameters
• Change state from host when workflow calls External Method?
• Editing XOML in VS2005 and other designer problems
• Querying workflow event
• Beta 2 HOL code snippets broken ?
• Visual resizing
• Workflow Instances persisted by different hosts
• Can i change the Tracking Profile in WFF at runtime?
• BPEL-compatible Workflow-Engine with WWF?
Bookmark and Share
Welcome to Bokebb   New Update  
 

New Articles

• Correct way to configure SQlPersistence
• Using WorkFlow to check Approval Status
• Interval between WorkflowIdled and persi
• Database monitor activity???
• EventSinkActivity Parameters
• How to update the .net framework with th
• Why and How StateMachineWorkflow in ASP.
• MCMS 2002 and WWF (Architecture Overview)
• WF Deployment in SharePoint Portal 2007
• Designer embedded in ASP.NET page
• Workflow monitoring in Beta 2/2.2
• Why doesn't ActivityTrackingRecord.Conte
• Limiatations of Workflows as web services
• WWF-SqlWorkflowPersistenceService
• Debugging Help

Hot Articles

• Workflow instances within a single Workf
• XAML activation of HandleExternalEventAc
• Any New ASP.NET/WF Functionality for Tec
• BUG?: Office Tools in Workflow Activity
• How to upgrade Beta 1 projects to Beta 2
• hi james ,about your asp.net web apps
• ASP.Net Designer example
• BizTalk Sever 2006
• Avalon.NET - WWF Runtime and AppDomains
• Two questions with WorkflowRuntimeService
• Beta 2 Designer Problems for Older workf
• What are .xoml files ?
• waiting for multiple events generated dy
• Activity Binding
• Args from WorkflowRuntime.CreateWorkflow

Recommend Articles

• Run a Workflow in a Workflow and cancel it
• workflow on web application
• Replicator with PolicyActivity hurts my
• Error Compiling ExternalRuleSetToolkit
• Errors while compiling xoml
• Sub-workflows - DesignSurfaceManager
• Newbie: Transistion lines not displayed
• How to get the list of Running Instances?
• Custom Tracking service in app.config, W
• Compilation Failed error...very generic...
• What OS support will be needed to deploy
• Persistenced Workflow Instances
• Persistence services
• Delay activity - 60 days timeout perid e
• two issue for Workflow,anyone can help me.