使用 WF4 的电子邮件工作流程
首先,我是新 WF (v4),但我可以看到好处,只是学习曲线目前阻碍了我,所以我需要你的帮助。
以我的场景为例,我有一个业务要求以不同的时间间隔发送一系列电子邮件。因此,我在工作流服务中创建了一个顺序工作流,并在每次邮件发送之间设置了适当的延迟。工作流程由 Recieve 调用启动。这部分似乎工作得很好。
不过,我希望进行第二次接收呼叫,以有效停止工作流程,以便不再发送电子邮件。
为了尝试实现这一目标,我配置了一个具有 2 个分支的 Pick 控件。分支 1 有一个 Receive with StartEmails,它会启动我的延迟电子邮件序列,如前所述。分支 2 包含第二个接收“StopEmails”,但是我的断点从未在“StopEmails 接收”上命中。我相信我已经设置了正确的关联,并且 CanCreatedInstance 设置为 false。
当第一个分支处于延迟(等待)状态时,我是否无法进行第二次调用?
任何指示将不胜感激。
Firstly I am new WF (v4), but I can see the benefits, it's just the learning curve that is holding me back at the moment so I need your help.
Take my scenario, I have a business requirement to send a series of emails at various intervals. So I have created a sequential workflow in a workflow service with the appropriate delays between each mail send. The workflow is started by a Recieve call. This part seems to work fine.
However I want a have a second Receive call that effectively stops workflow so no more emails sent.
To try and achieve this I configured a Pick control with 2 branches. Branch 1 has a Receive with StartEmails which starts my delayed sequence of emails as describe before. Branch 2 contains a second Receive 'StopEmails, however my breakpoint never gets hit on the StopEmails Receive. I beleieve I have setup the correct correlation and CanCreatedInstance is set to false.
Is it that I can't make a second call while the first branch is in a delay (waiting) state?
Any pointers would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过更多的挖掘之后,我相信我找到了答案。请参阅这篇文章Workflow Foundation 4.0 消息关联和错误报告
我的想法是正确的,正是我的第一个分支的延迟阻止了我的第二个接收请求的执行。用并行容器替换我的 Pick 解决了这个问题。仔细想想就很有道理!
并行容器来救援!
After a little more digging on SO, I believe I found my answer. see this post Workflow foundation 4.0 message correlation and error reporting
I was correct in my thinking that it was the delay in my first branch was what was blocking my second Receive request from being executed. Replacing my Pick with a Parallel container solved the problem. Makes sense when you think about it!
Parallel container to the rescue!