顺序工作流程问题 [英] Sequential WorkFlow Problems

查看:128
本文介绍了顺序工作流程问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用顺序工作流程:
我试图从控制台应用程序调用工作流,并且调用工作流具有一些子工作流.当我运行控制台应用程序时,它将进入数据库并获得一些记录,例如500.然后它将这些记录一个一个地传递给工作流程,因此,基于这些值,我的工作流程将同步调用另一个工作流程以检查某些字段值然后根据输出结果,第一个工作流程将插入或更新到其他数据库中,并且从主要工作流程中,我在完成更新和插入之后又调用了两个独立的异步工作流程.但是这里面临的问题是,第一组记录要花费240秒,第二组新记录要花费相同的时间,而第三组新记录要花费2个半小时以上但我不知道为什么下一组记录要花这么长时间.
但是有一件事是,如果我关闭控制台应用程序并运行它,则它对于两套记录工作正常,而对于第三套记录正在发生同样的事情,请问有人可以帮我吗?

当我检查在任务管理器中运行此应用程序时,内存使用量不断增加
我通过使用控件来调用所有这些工作流程:工具箱中的InvokeWorkFlowActivity

从控制台应用程序调用:

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:

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?

推荐答案

这是性能问题.原因是您发布的另一个问题: http://www.codeproject .com/Questions/82869/Performance-issues-wih-work-flows.aspx [
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.


这篇关于顺序工作流程问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆