如何决定哪些内容在工作流程中保留,哪些内容不保留
我有一个关于持久工作流程中值状态持久性的问题。我的一个扩展类中有两个属性:
public int ApprovalCount
{
get;
set;
}
public bool ApprovedByAllInitialApprovers
{
get;
set;
}
这些属性是在另一种方法上进行的某些计算期间设置的。
我的问题是,当工作流程空闲并持续存在时,这些值的状态也会保存到数据库中,因此,如果我再次调用扩展类上的方法,我将拾取我离开时的值;我知道这种行为显然对于工作流以持久方式运行的方式相当重要,并且在 90% 的情况下,我确实希望记住并持久保存值,但是例外情况又如何呢?有什么方法可以“标记”一个属性(可能带有一个属性)以表明我不希望它保留?或者我必须在每次计算之前重置这些值?
非常感谢任何帮助。提前致谢。
I have a question with regards to persistence of value states in a persisted workflow. I have two properties inside one of my Extension classes:
public int ApprovalCount
{
get;
set;
}
public bool ApprovedByAllInitialApprovers
{
get;
set;
}
These properties are set during some calculations that take place on another method.
My problem is, when the workflow goes idle and persists, the state of these values is also persisted to the database, so if I call the method on my extension class again, I am picking up the values as I left them; I understand this behaviour is obviously fairly fundamental to the way workflows operate in a persisted fashion and in 90% of cases I do want values to be remebered and persisted, but what about exceptions to this? Is there any way I can 'mark' a property (perhaps with an attribute) to indicate that I do not want it persisted? Or must I simply reset the values before I do my calculation each time?
Any help greatly appreciated. Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这个问题有两个答案。
There are two answers to this question.