工作流服务未调用另一个项目中的工作流
我有一个 Windows 工作流服务 4.0,它调用位于另一个项目(即另一个程序集)中的工作流。
我已在工作流服务项目中创建了对其他程序集中工作流的项目引用。
我在工作流服务接收活动中设置了一个断点,并且该断点被命中。
接下来,我进入下一个活动,该活动位于另一个项目中,并且调试器不起作用。
另一个工作流程是发送电子邮件。似乎其他工作流程没有被调用,因为我从未收到来自其他项目中的工作流程的电子邮件。
非常感谢任何帮助。
在 Visual Studio 2010 中很容易重现此问题。
1.) 创建一个新的 WCF 工作流服务应用程序项目并保存解决方案。
2.) 将新的活动库添加到解决方案中。
3.) 在活动库中,转到工具箱并添加序列活动。添加写入事件日志的代码活动。编译活动库,并从工具箱中将写入 Windows 事件日志的代码活动添加到序列活动中。
4.) 在工作流服务项目中,添加对活动库项目的项目引用。
5.) 在工作流服务项目中,在 ReceiveRequest 活动和 Activity Library 工作流活动之后。
6.) 在工作流服务项目 ReceiveRequest 活动中设置一个断点,并在写入事件日志的活动库代码活动行中设置另一个断点。
7.) 运行调试器,您将看到活动库断点永远不会被命中,而且如果您在没有调试器的情况下运行,活动库永远不会执行(您可以检查Windows事件日志以确认活动库从未执行) 。
请提出解决方案。
I have a windows workflow service 4.0 that calls a workflow located in another project (i.e. another assembly).
I have created a project reference in my workflow service project to the workflow in the other assembly.
I have set a breakpoint in the workflow service receive activity and this breakpoint is hit.
Next I step into the next activity which is an activity located in another project and the debugger does not work.
Also the other workflow is sending an email. It appears that the other workflow is not being called because I never receive an email from the workflow in the other project.
Any help is greatly appreciated.
This problem is very easy to reproduce in Visual Studio 2010.
1.) Create a new WCF Workflow Service Application project and save the solution.
2.) Add a new Activity Library to the solution.
3.) In the Activity Library, go to the toolbox and add a sequence activity. Add a code activity that writes to the event log. Compile the Activity Library and from the toolbox add the code activity the writes to the windows event log to the sequence activity.
4.) In the workflow service project, add a project reference to the Activity library project.
5.) In the workflow service project, after the ReceiveRequest activity and the Activity Library workflow activity.
6.) set a breakpoint in the workflowservice project ReceiveRequest activity and another breakpoint in the Activity Library code activity line that writes to the event log.
7.) Run the debugger and you will see that the Activity Library breakpoint is never hit and also if you run without the debugger, the activity library is never executed (you can check the windows event log to confirm that the activity library never executed).
Please advise on a resolution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我已经找到解决问题的方法了!
问题是您不能只删除 SendResponse 活动(使其成为“单向”即发即忘)并在 ReceiveRequest 活动之后添加位于另一个项目中的 ActivityLibrary 活动。您需要删除 ReceiveRequest 活动,同时删除 SendResponse 活动,并将 ReceiveRequest 活动替换为 Receive 活动,以使其成为“单向”活动。
以下是我为解决该问题所做的操作:
1.) 我删除了 ReceiveRequest 和 SendResponse 活动。
2.) 我添加了一个接收活动并将 CanCreateInstance 属性设置为 True。
3.) 我在接收活动之后添加了位于另一个项目中的活动库中的活动。
好交易!现在可以了。
里奥·科诺 - http://www.PeopleFriends.com
I have figured out the solution to the problem!
The problem is that you cannot just delete the SendResponse activity (to make it "One-Way" Fire and Forget) and add the ActivityLibrary activity located in another project after the ReceiveRequest Activity. You need to delete the ReceiveRequest activity and also delete the SendResponse activity and replace the ReceiveRequest activity with the Receive Activity to make it "One-Way".
Here is what I did to resolve the problem:
1.) I deleted ReceiveRequest and SendResponse activities.
2.) I added a Receive Activity and set the CanCreateInstance property to True.
3.) I added the Activity from the ActivityLibrary located in another project after the Receive Activity.
Good deal! It now works.
Leo Cono - http://www.PeopleFriends.com