WF 3.5 有状态活动
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为什么需要关闭工作流程?看起来它还没有完成:)考虑有一个循环并且在完成之前不关闭。
如果必须关闭它并且需要存储文件的行号以供“下次运行”。也许将其存储在其运行的实体上。
或者有两个工作流程,一个控制器存储文件行号并调用子工作流程来进行处理。
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.