WF 3.5 有状态活动

发布于 2024-08-07 06:46:47 字数 226 浏览 4 评论 0原文

我正在使用 WF 3.5,并寻找一种方法来开发一个活动,在标准 WF“while”活动的不同迭代中保留其状态。问题是,通常活动的 Execute() 方法应返回“已关闭”执行状态。一旦这样做了 - 它就无法返回到“正在执行”状态,并且在下一次迭代中使用该活动的新克隆,因此我们丢失了第一个活动的状态。例如,我希望我的活动在每次迭代中对输入文件的下一行进行采样。它需要维护该文件的游标,或者换句话说,它需要一个状态。我怎样才能实现这个功能?

I'm using WF 3.5 and looking for a way to develop an activity preserving its state among different iterations of the standard WF "while" activity. The problem is that normally the Execute() method of an activity should return the "Closed" execution status. Once it did that - it cannot get back to the "Executing" state and in the next iteration a new clone of the activity is used and thus we lose the state of the first one. For example, I want my activity to sample the next line of an input file in each iteration. It requires maintaining a cursor for this file or in other words it requires a state. How can I achieve this functionality?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

蓝海似她心 2024-08-14 06:46:47

为什么需要关闭工作流程?看起来它还没有完成:)考虑有一个循环并且在完成之前不关闭。

如果必须关闭它并且需要存储文件的行号以供“下次运行”。也许将其存储在其运行的实体上。

或者有两个工作流程,一个控制器存储文件行号并调用子工作流程来进行处理。

Why do you need to close your workflow? It seems it has not finished yet :) Consider have a loop and not closing until you have finished with it.

If you must close it and need to store the line number of the file for the "next run". Perhaps store that on the enitity it's running from.

Or having two workflows a controler that stores the file line number and calls the child workflows to do the processing.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文