locked
How to load a persisted workflow and resume a bookmark from the client with WorkflowServiceHost RRS feed

  • Question

  • Hello, my name is Paúl and I need some help in WF4, I hope you can help me.

    So, at first I need to self-host a workflow created in xaml, each workflow activity creates a bookmark when executed. (later I will host it in II7/AppFabric)

    From the client I need to create instances and then with the instance id and the bookmark name, resume the workflow.

    I've tested this with the Microsoft samples :

    - <InstallDrive>:\WF_WCF_Samples\WF\Basic\Execution\ManagementEndpoint

    - <InstallDrive>:\WF_WCF_Samples\WF\Basic\Execution\ResumeBookmarkEndpoint

    The first one works just fine, I create my instances and then in the database the workflow is persisted with the first bookmark name. So, then with the second example I just can't make the workflow load from the persistence and resume the bookmark (from the client, obviously).

    Any help would be appreciated.

    Thanks.

    Paúl Vega

    Thursday, December 16, 2010 5:38 PM

Answers

All replies

  • Hi, Paul

    ->"(later I will host it in II7/AppFabric)"
    If you are going to host workflow in IIS7/AppFabric. you'd better use Receive activity instead of bookmark activity(Receive activity is also a bookmark activity). So that you can resume a persisted workflow by a WCF request.

    ->"So, then with the second example I just can't make the workflow load from the persistence and resume the bookmark (from the client, obviously)."
    Did you get any error message? could you find any info by setup tracking?

    Regards
    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    Tuesday, December 21, 2010 2:21 AM
  • Hello, thanks for the reply.

    -->(If you are going to host workflow in IIS7/AppFabric. you'd better use Receive activity instead of bookmark activity. So that you can resume a persisted workflow by a WCF request.)
    You mean that I could enqueue a Receive activity in each activity execution in order to call it later and resume the workflow? or in the workflow definition I should have many Receive activities?

    -->(Did you get any error message? could you find any info by setup tracking? )
    With the initial setup I can resume the workflow, activity by activity...so, when executed, the first activity is "waiting", then I resume that activity and the next (one or more on parallel) become "waiting" ... all this is done only in memory (console prints "Activity1:Waiting..." then "Activity1:Resumed; Activity2:Waiting, Activity3:Waiting); but in the database there is no update in the BlockingBookmarks column, only the Version column gets updated.

    Another question I have: is there a way to know the statusses of the activities in a persited workflow? I mean, which ones are executed and which ones are Ready to execute?

    Hope you can help me, this is giving me terrible headaches :P

    Thanks.

    Paúl.

    Wednesday, December 22, 2010 9:33 PM
  • Hi, Paul

    ->"or in the workflow definition I should have many Receive activities?"
    If the host is IIS/Appfabric.  Yes, you should have many Receive activities, if you want to set correlation for these Receive activities, this link could help some:
    http://xhinker.com/post/WF4Correlate-Multiple-Receive-Activities.aspx

    ->"then I resume that activity and the next (one or more on parallel)"
    You should use Pick activity instead of Parallel activity.
    http://msdn.microsoft.com/en-us/library/ee358746.aspx


    ->"Another question I have: is there a way to know the statusses of the activities in a persited workflow? I mean, which ones are executed and which ones are Ready to execute?"
    The easiest way is use the WF4 tracking. If you are planing to write more code, you also create your own visual tracking
    VisualWorkflowTracking

    See http://blogs.msdn.com/b/kushals/archive/2009/12/22/visualworkflowtracking-aka-workflowsimulator.aspx

    Hope this helps
    Regards


    MSDN Community Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    This posting is provided "AS IS" with no warranties, and confers no rights. My Blog: http://xhinker.com
    Microsoft Windows Workflow Foundation 4.0 Cookbook
    • Marked as answer by Andrew_Zhu Monday, December 27, 2010 2:40 AM
    Thursday, December 23, 2010 3:45 AM