Windows WorkFlow Foundation

Posted by Praveen1234 under WPF on 5/17/2010 | Views : 1954 | Status : [Member] | Replies : 0
Hi All,



Im 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 thwn i will pass those filed values to work flow so based on the values my work flow will invoke another work flow synchrously to check whether this record is already present or not 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 im calling to 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 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 dont 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?

Im calling all these work flows by using control: InvokeWorkFlowActivity which is in the tool box

Calling from Console Application:



AutoResetEvent waitHandle = new AutoResetEvent(false); delegate(object sender, WorkflowCompletedEventArgs e)

workflowRuntime.WorkflowCompleted +=

{

waitHandle.Set();

noOfInsertsMaster =

noOfUpdatesMaster =

noOfInsertsChild =

noOfUpdatesChild =

startofAllWorkFlows =



};delegate(object sender, WorkflowTerminatedEventArgs e)

workflowRuntime.WorkflowTerminated +=

{

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



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

workflowRuntimeSecondChild =



workFlowInsatnceSecondChild.Start();

The asychrnous call:

WorkflowRuntime

W



workflowRuntimeGeoCode =



workFlowInsatnceGeoCode.Start();




Responses

(No response found.)

Login to post response