开发者

Persisting values in windows workflow foundation 4.0

开发者 https://www.devze.com 2023-03-22 11:32 出处:网络
I\'ve a windows workflow service that is hosted in a console application. I have a count variable in the service and the value is incremented in each call, how I can make the count value to be persist

I've a windows workflow service that is hosted in a console application. I have a count variable in the service and the value is incremented in each call, how I can make the count value to be persistent between calls.

EDITED: The workflow takes a timeout value as input and 开发者_JAVA技巧returns an id. If you pass 10 as the timeout value the workflow delays for 10 seconds and return the id 1. In between if another client pass 3 as the timeout value a new instance of workflow has to be created and it has to wait for 3 seconds returning the new id value as 2.


If you are referring to a variable per workflow instance you can create a variable at the root sequence of you workflow and store. If the workflow is persisted to disk this variable will be saved with it.

However from you question it seems you are referring to a variable per workflow type. In that case there is no static variable per workflow type and you need to manage the state outside of the workflow and persist it yourself.

0

精彩评论

暂无评论...
验证码 换一张
取 消