Home » WWFRSS

XOML only workflow performance issue while creating

  In our application we are using XOML workflow and create workflow instance using workflowRuntime.CreateWorkflow(workflow, ruleReader, workflowParameters) where workflow and ruleReader are objects of XMLReader created using XmlReader.Create().

For one of our business process automation we have developed XOML only workflow which has 35 states and 95 events. When we try creating an instance of the workflows it is taking more time and the time taken to create the instance is 3 min.

Can any one suggest is there any other way to create workflow instance of XOML only workflows other than workflowRuntime.CreateWorkflow(workflow, ruleReader, workflowParameters)

Your help is higly appreciated.

Environment:
    VS 2008
    ASP.NET 3.5
    WWF 3.5
    XP
 
 

11 Answers Found

 

Answer 1

Hi,

There are many factors will impact on the performance  of workflow  application. When you create  a new instance, two main actions will impact on the performance:
1. Activity Exection Context cloning
2. Rule initialization.

I would recommend you read through this article:
http://msdn.microsoft.com/en-us/library/aa973808.aspx

Regards
 

Answer 2

Hi Andrew,

Thanks for the article.

here i am looking for a alternative or some method to tweak the huge XOML workflow  while creating  the instance.

the maximum time  to create  an instance  is going in the createWorkflow method (have a look at the line of code).

WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(XmlReader.Create(_myXomlWorkflowFile), newXmlTextReader(_myXomlRulesFile), workflowParameters);

Please let me know if we have any option to tweak this method by adding any properties or any other way..

Regards
Balu.
 

Answer 3

i am looking for a alternative or some method to tweak the huge XOML workflow  (around 5000 lines in xmleditor) while creating  the instance. the maximum time  to create  an instance  is going in the createWorkflow method (have a look at the line of code).

the workflow contains around 35 states  and more than 100 events.

WorkflowInstance workflowInstance = workflowRuntime.CreateWorkflow(XmlReader.Create(_myXomlWorkflowFile), new XmlTextReader(_myXomlRulesFile), workflowParameters);

We also use the persistance service provided by WWF as well.

Please let me know if we have any option to tweak this method by adding any properties or any other way..
 

Answer 4

Hi , Balu

-“Please let me know if we have any option to tweak this method by adding any properties or any other way..”
I don't think add properties to the method will change anything. because it could be the xoml  workflow structure that caused the low performance(the article list many factors on it). unless find the real reason hinder the instance  generation. there is no easy way to solve the problem.

Regards 
 

Answer 5

Hi Andrew,

We are checking for the exact reason for the low performance.


SELECT DATALENGTH(state) FROM [InstanceState] WHERE uidInstanceID = @uidInstanceID

For all the other workflows  in our application  its around 20,000 but for this workflow  its around 3, 28,993 i guess this is a huge value when compared to other workflows. 

let me know if the data given above might help  us to come to a conclusion.

Thanks in advance.




 

Answer 6

Hi,

->"For all the other workflows  in our application  its around 20,000 but for this workflow  its around 3, 28,993 i guess this is a huge value when compared to other workflows. "
Yes, it is a large amount data. so, how about delete it for test. what is the result come out.

Regards
 

Answer 7

What should i delete... Do you mean deleting the data which is stored previously...

 

Answer 8

Hi,

Would you mind send me a sample of your xoml  workflow so that I can look into it: xhinker[at]gmail.com.
I also find you created  another thread on this issue.
http://social.msdn.microsoft.com/Forums/en-US/windowsworkflowfoundation/thread/279c89f4-4e34-4a37-b875-5a8ea990dfce

Regards
 

Answer 9

Hi,

We are facing the same issue  in one of our applications. The output the SELECT DATALENGTH... query returns a value of 567088. Were you able to solve the problem? If so, what was the solution? There is a suggestion to delete and test - what should be deleted ?

thanks, Siva

 

 

Answer 10

Hi,

There are many factors will impact on the performance of workflow  application. When you create  a new instance, two main actions wll impact on the performance:
1. Activity Exection Context cloning
2. Rule initialization.

I would recommend you read through this article:
http://msdn.microsoft.com/en-us/library/aa973808.aspx

Regards
This posting is provided "AS IS" with no warranties, and confers no rights. Microsoft Online Community Support

Thanks for your explanation! This is what I'm looking for, It's very valuable.
 

Answer 11

Is there any difference at all between the workflow  definitions and the contents of the rules file or are they identical? When you create  a workflow by loading from markup it is cached, and subsequent CreateWorkflow with the same contents will use the same activity tree from the previous call. If they are different then a new activity tree is generated for each one, so subsequent calls are not as fast as they could be, and in fact they might get slower if there are many workflow definitions to compare to see if there is an existing activity tree to use. If this is the case (and if it is the usual difference as property values on the root workflow) then you could make it so the definitions are the same, and you could pass in the different values as input arguments to the workflow. if you have tracking enabled it will generate a different profile for each one if they are slightly different and that can slow things down as well.

If they are the same, then you could speed it up a couple of ways:

1. Turn off validation (you could do this if they are different, but if each one is different then you may want to keep this enabled inc ase one of the variations introduces a problem). if this markup is from a trusted source then you don't need to validate each time  you create an instance.

2. Compile the markup into an assembly (you can do this right from your hosting app) and then create the new instances using the type from the assembly and not the markup.

There are demos of these approaches in the following Xaml Workflow Workshop:

http://blogs.msdn.com/b/endpoint/archive/2008/07/06/download-posted-wf-xaml-workshop.aspx

or you can jump right to the download here:

http://www.microsoft.com/downloads/en/details.aspx?FamilyID=26aeeeaf-d68e-41ff-8584-09cc7f6dd0bc&displaylang=en

Hopefully this info helps, and if I have misunderstood your scenario please let me know and I can try to provide additional information.

Thanks,

Steve Danielson [Microsoft]
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at http://www.microsoft.com/info/cpyright.htm

 

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Follow us on Twitter