状态机持久化工作流程
大家好,我创建了一个 WinForms 来使用 Windows WorkFlow Foundation 处理持久性活动。我使用.NET 3.0 SQL和VS2005作为IDE,使用C#作为代码语言。此外,环境也是公司发展政策对我的要求。因此,在恐龙决定升级之前,我一直坚持使用 VS2005。
我的问题是这样的,我能够一次处理 1 个工作流程,并且我希望能够处理多个工作流程。就像当我单击表单上的“提交”按钮时,我希望能够创建一个新的工作流实例。
我创建了运行时并添加了所有适当的服务。我挂钩持久性,当我单击“提交”时,我启动了工作流的一个实例。我对 WorkFlow Foundation 比较陌生,MSDN 链接对我几乎没有提供任何帮助。如果有人可以在我的源代码中将我置于正确的方向,那将会很有帮助。
我已附上我的项目源代码的链接。
提前致谢!
Hey all, I have created a WinForms to handle Persistence Activities using the Windows WorkFlow Foundation. I'm using the .NET 3.0 SQL and VS2005 as the IDE with C# as the code language. Also, the environment is mandated to me by the corporate policy for development. So until the dinosaurs decide to upgrade, I'm stuck with VS2005.
My probelm is this, I'm able to work with 1 workflow at a time, and I'd like to be able to handle Multiple workflows. As in when I click the Submit button on my form, I'd like to be able to create a new WorkFlow instance.
I created the runtime and add all the appropriate services. I hook in persistence, and when I click the Submit I start an instance of the WorkFlow. I'm relatively new to the WorkFlow Foundation, and the MSDN links have provided little to no help for me. If anyone could put me in the right direciton within my source code, that would be helpful.
I have attached a link to the source for my project.
Thanks in Advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我看了一下,每次单击“提交”时,您似乎都在创建一个新的工作流程。我得到了一个新的实例 id,这是一个好兆头 :) PopulatePSUP(string instanceID) 捕获下拉列表的实例 id。但您一次仅在 Guid _instanceID 中存储一个实例 ID。然后,该表单级别变量将用于所有按钮事件。您可以直接使用 cboPSUPItems.Text。
类似于:
您可能还想考虑使用集合/列表来存储instanceId。适用于任何工作流程范围的逻辑。
像这样的东西:
I had a look and it appears that you are creating a new workflow each time you click submit. I get a new instance id, which is a good sign :) PopulatePSUP(string instanceID) captures the instance id for the dropdown. But you are only storing one instance id at a time in Guid _instanceID. This form level variable is then used for all the button events. You could insead use the cboPSUPItems.Text.
Something like:
You might want to think about using a collection/list to store the instanceIds in as well. For any workflow wide logic.
Something like: