How to resume bookmarking from inside NativeActivity?

I have an activity that schedules an operation for an external API, and then should continue only when this external API ends, which is indicated by an event. I am currently using NativActitivy.

My idea would be to set a bookmark and then register an event handler that will trigger the bookmark. Unfortunately, it seems that I cannot resume the bookmark with context.

What is the best way to do this?

The flow is as follows: * Getting started * Task assignments for the external completion of the API. * Avtiovity calls an external API and registers an event handler * An activity event handler listens for all completion events until the correct one appears (there is a parameter that identifies which request was completed) * Then the activity resumes the bookmark and ends.

Does anyone have some sample code for this? I am currently using natie activity, but I want to change.

+4
source share
1 answer

To do this, you need to create an extension. Think about it: while you wait for an external event to occur, your workflow is idle. So you need a guy (IWorkflowInstanceExtension) outside of your workflow to reactivate it.

Examples for:

http://blogs.msdn.com/b/patcarna/archive/2010/01/19/windows-workflow-4-0-workflow-instance-extensions.aspx

http://msmvps.com/blogs/theproblemsolver/archive/2010/01/27/using-wf4-bookmarks-with-iworkflowinstanceextension.aspx

+4
source

Source: https://habr.com/ru/post/1389662/


All Articles