简体   繁体   中英

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. Using the documentation and tutorials from MS I designed a basic Workflow with custom Activities. 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. 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.

Has anybody done sth. like this or a hint how to solve this Issue?

ResumeBookmark does take a input with type object. This will be available in your 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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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