是否可以在 MethodInvoking 事件处理程序中取消工作流活动?
我有一个带有 SendEmail
活动的 SharePoint 工作流。我使用 MethodInvoking
事件处理程序来设置 To
属性。
但是,有时工作流不应尝试发送电子邮件,因为没有电子邮件地址。我可以在 MethodInvoking 事件处理程序中检测到这种情况。是否可以跳过 SendEmail
活动并继续下一个活动?
我知道我可以将 IfElseActivity
放在 SendEmail
之前,但我正在寻找一种取消活动执行的方法。
I have a SharePoint workflow with a SendEmail
activity. I use the MethodInvoking
event handler to set the To
property.
However, sometimes the workflow should not try to send an e-mail, because there is no e-mail address. I can detect such a condition in the MethodInvoking
event handler. Is it possible to skip the SendEmail
activity and proceed to the next one?
I know I can put IfElseActivity
before SendEmail
, but I am looking for a way to cancel activity execution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从SDK来看,所有的Activity都有一个Canceling事件。然而,我发现的似乎表明,只有当整个工作流程遇到错误或被取消时,活动才会被取消。您似乎无法手动取消单个活动(我不确定工作流程是否知道下一步要做什么)。因此,IfElse 分支或 ConditionedActivityGroup 可能是您最好的选择。
From looking at the SDK, all activities have a Cancelling event. However, what I find seems to suggest that an activity is only cancelled if the entire workflow hits an error or is cancelled. It does not appear that you can manually cancel a single activity (I'm not sure the workflow would know what to do next). So an IfElse branch, or a ConditionedActivityGroup, would probably be your best shot.