InstancePromotedProperties 表中没有数据
我正在尝试在 Worfklows 上测试 Microsoft 的示例。此示例 WF_WCF_Samples\WF\Basic\Persistence\PersistenceParticipants 正在运行,但持久工作流的数据未存储在 InstancePromotedProperties 表中。谁能解释一下如果数据不存储在该表中是如何工作的?谢谢您的时间
I am trying to test the Microsoft's examples on Worfklows. This example WF_WCF_Samples\WF\Basic\Persistence\PersistenceParticipants is working but the data of the persisted workflow doesnt stored in the InstancePromotedProperties Table. Can anyone explain how is working without the data being stored in this table?. Thx for your time
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该设置有些棘手,不同的移动部件必须匹配。
首先,您需要使用 SqlWorkflowInstanceStore.Promote() 告诉 SqlWorkflowInstanceStore 将值存储在 InstancePromotedProperties 表中。接下来,您需要一个 PersistenceParticipant,您需要在其中重写 CollectValues() 并将要提升的值存储在 2 个集合中的任意一个中。最后,您必须将工作流中的数据获取到之前创建的 PersistenceParticipant 中。这可以使用 TrackingParticipant 或自定义活动来完成。
无论您做什么,都需要确保所有 XName 都匹配。在 CollectValues() 中添加一个并提升另一个,什么都不会发生,也不例外。并且提升布尔值存在一个错误。这会导致没有数据写入 InstancePromotedProperties,因此请确保在收集它们之前将它们转换为整数或字符串。
The setup is somewhat tricky with different moving parts that have to match.
First of all you need to use the SqlWorkflowInstanceStore.Promote() to tell the SqlWorkflowInstanceStore to store the values in the InstancePromotedProperties table. Next you need a PersistenceParticipant where you need to override the CollectValues() and store the values you want to promote in either of the 2 collections. And finaly you have to get the data from you workflow into the previously created PersistenceParticipant. That can be done using a TrackingParticipant or a custom activity.
Whaever you do you need to make sure all XNames match up. Add one in the CollectValues() and promote another and nothing will happen, no exception either. And there is a bug with promoting boolean values. That causes no no data to be written to the InstancePromotedProperties so make sure to turn them into integers or strings before collecting them.