基于HandleExternalEventActivity的自定义活动

发布于 2024-07-29 22:37:08 字数 412 浏览 1 评论 0原文

我将 HandleExternalEventActivityRoles 属性一起使用,我需要检查我的 custom bool RoleProfile.IsDelegatee(string userName, stringworkflowName , string ActivityName, string eventName, string roleName) 方法找到匹配项。 (“我正在度假;UserX 应该能够代表我批准‘任务 X’,但不能批准‘任务 Y’”)

我尝试继承 HandleExternalEventActivityExecute 方法被标记为密封。

你有什么想法?

TIA

I'm using HandleExternalEventActivity with Roles property and I need to check if my custom bool RoleProfile.IsDelegatee(string userName, string workflowName, string activityName, string eventName, string roleName) method finds a match. ("I'm on vacation; UserX should be able to approve 'task X' on my behalf, but not 'task Y'")

I tried to inherit HandleExternalEventActivity but Execute method was marked as sealed.

Do you have any ideas?

TIA

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小梨窩很甜 2024-08-05 22:37:09

我认为 HandleExternalEventActivity 不允许您执行此操作,它允许您验证的内容受到限制。 但是,ReceiveActivity 有一个 OperationValidation 事件,可让您在代码中执行所需的任何操作,并在 OperationValidationEventArgs 上设置 IsValid 属性以指示是否允许调用。

如果您不愿意或无法采用 WCF 路线,最好的选择是创建一个对排队消息做出反应的自定义活动。 HandleExternalEventActivity 只是工作流排队系统的一个非常薄的包装,我几乎总是建议人们采用自定义活动路线而不是 HandleExternalEventActivity 路线,因为它更加灵活并且通常更易于使用。

I don't think the HandleExternalEventActivity lets you do this, it's limited in what it will let you validate. However the ReceiveActivity has a OperationValidation event that lets you do whatever you want in code and set an IsValid property on the OperationValidationEventArgs to indicate if the call is allowed or not.

If you are not willing or able to go the WCF route the best option is to create a custom activity that reacts to queued messages. The HandleExternalEventActivity is only a very thin wrapper over the workflow queuing system and I nearly always advise people to go the custom activity route instead of the HandleExternalEventActivity route as it is far more flexible and often even easier to use.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文