简体   繁体   English

在Workflow Foundation中触发的条件

[英]Condition for a Trigger in Workflow Foundation

I have to implement a workflow in our application and decided to give Windows Workflow Foundation a try. 我必须在我们的应用程序中实现工作流,并决定尝试Windows Workflow Foundation。 Using the documentation and tutorials from MS I designed a basic Workflow with custom Activities. 使用MS的文档和教程,我设计了带有自定义活动的基本工作流。 I have a custom activity as a Trigger for a Transition from State A to State B. This activity creates a Bookmark which is executed / resumed by the user after a while. 我有一个自定义活动,作为从状态A到状态B转换的触发器。此活动创建了一个书签,该书签在一段时间后由用户执行/恢复。 This works as expected. 这按预期工作。

But now I'm stuck. 但是现在我被卡住了。 I'd like to define a condition for the Trigger of this transition which only allows the user to resume the Bookmark if the condition is met (eg the user must have special rights or a property must be set). 我想为此转换的触发器定义一个条件,该条件仅在满足条件时才允许用户恢复书签(例如,用户必须具有特殊权限或必须设置属性)。

What I see in the Workflow Foundation Editor is, that I can define a condition for the Transition, that is evaluated after the Bookmark is resumed but I need this before. 我在Workflow Foundation编辑器中看到的是,我可以定义过渡的条件,该条件在恢复书签之后进行评估,但在此之前需要。

Has anybody done sth. 有人做过什么吗? like this or a hint how to solve this Issue? 像这样或提示如何解决此问题?

ResumeBookmark does take a input with type object. ResumeBookmark确实接受类型为object的输入。 This will be available in your BookmarkCallback. 这将在您的BookmarkCallback中可用。 Once bookmark resumed you may evaluate the input and make decision based on the input value. 书签恢复后,您可以评估输入并根据输入值进行决策。 If the evaluation is passed, move to your next state, otherwise go back to itself. 如果评估通过,则移至下一个状态,否则返回自身。

You want the control to happen before resume bookmark, but my alternative is to allow the bookmark resume, then evaluate the access control. 您希望控件在恢复书签之前发生,但是我的替代方法是允许书签恢复,然后评估访问控制。 Will that work for you? 那对你有用吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM