Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am Using Sequential Work Flow:
I trying to call a Work Flow from an console application and the calling work flow have some child work flows. when i run my console application it goes to the database and gets some records ex 500. and then it will pass those records one by one to work flow so based on the values my work flow will invoke another work flow synchronously to check some fields values and then based on the out put the first work flow will do insertion or update into other database and also from the main work flow i am calling two more independent asynchronous work flows after the completion of updation and insertion. But the problem im facing here is for the first set of records it is taking 240 seconds and for the second new set of records it is taking same amount of time but from the third set of new records it is taking more than 2 and half hours but i don't have any clue why it is taking so long for the next set of records.
But one thing is, if i close the console application and run it, it works fine for two set of records and same thing is happening for third set can any one please help me with this?

When i check running this application in my task manager the memory usage keeps on increase
Im calling all these work flows by using control: InvokeWorkFlowActivity which is in the tool box

Calling from Console Application:
C#
AutoResetEvent waitHandle = new AutoResetEvent(false);
workflowRuntime.WorkflowCompleted +=  delegate(object sender, WorkflowCompletedEventArgs e)
{
noOfInsertsMaster=Convert.ToInt32(e.OutputParameters[NO_INSERTS_MASTER]);
noOfUpdatesMaster=Convert.ToInt32(e.OutputParameters[NO_UPDATES_MASTER]);

waitHandle.Set();


};
workflowRuntime.WorkflowTerminated += delegate(object sender, WorkflowTerminatedEventArgs e)
{
Console.WriteLine(e.Exception.Message);
waitHandle.Set();
}
workflowInstance = workflowRuntime.CreateWorkflow(workFlowToUpdateDC_Type, UonInfo);
workflowInstance.Start();
manualService.RunWorkflow(workflowInstance.InstanceId);

waitHandle.WaitOne();



In the work Flow where im invoking the other work flow is:
AutoResetEvent
workflowRuntimeChild.WorkflowCompleted += delegate(object sender1, WorkflowCompletedEventArgs e1)
{
waitHandle.Set();
wbnVzId = e1.OutputParameters[WBNVzID].ToString();

uonVzId = e1.OutputParameters[UONVzID].ToString();
};
workflowRuntimeChild.WorkflowTerminated +=delegate(object sender1, WorkflowTerminatedEventArgs e1) 

{
Console.WriteLine(e1.Exception.Message);

waitHandle.Set();
};
  

workFlowInsatnceChild = workflowRuntimeChild.CreateWorkflow(workFlowChildType, constructedUonInfo);
workFlowInsatnceChild.Start();
manualService.RunWorkflow(workFlowInsatnceChild.InstanceId);

waitHandle.WaitOne();

the Invoking of other two asynchrnous work flow is:
WorkflowRuntime workflowRuntimeSecondChild  = new WorkflowRuntime();

Type workFlowSecondChildType = typeof(WorkFlowForUpdateDC.WorkFlowToUpdateJobParamater);
 workFlowInsatnceSecondChild = workflowRuntimeSecondChild.CreateWorkflow(workFlowSecondChildType, parametersToSecondWorkFlow);
workflowRuntimeSecondChild =  workFlowInsatnceSecondChild.Start();

The other asychrnous call:

workflowRuntimeGeoCode = null;

WorkflowRuntime  workflowRuntimeGeoCode = new WorkflowRuntime();
 Type workFlowGeoCodeType = typeof(WorkFlowForUpdateDC.WorkFlowToGetGeoCode);

workFlowInsatnceGeoCode = workflowRuntimeGeoCode.CreateWorkflow(workFlowGeoCodeType, parametersToCalculateGeoCode);
workFlowInsatnceGeoCode.Start();

Please let me know if i am doing anything wrong here?
Posted
Updated 20-May-10 19:01pm
v2

1 solution

It's a performance issue. The reason is your other problem that you have posted: http://www.codeproject.com/Questions/82869/Performance-issues-wih-work-flows.aspx[^]

After second workflow, the memory is short in space and thus third workflow takes much much longer. You need to handle the memory space issue and this should be resolved.
 
Share this answer
 
Comments
praveenreddy12 21-May-10 13:36pm    
How do i handle that?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900