locked
Manipulate variable of Workflow Instance when Loaded from persistent store RRS feed

  • Question

  • Hi, I am currently developing a State Machine XAML workflow service that hosted on IIS with AppFabric.

    I have a global scope variable , e.g. List<MyClass> for the workflow and adding more elements into the List as the workflow execute.

    I also have a custom PersistentIOParticipant to save the new elements added to the List variable to a SQL database table, during the stage of workflow persisting (unload from memory when idle).

    The list elements should only be saved to the database with PersistentParticipant because they should be in the same transaction with default instance persistence and will be rolled back if any saving operation failed (including workflow suspension). Hence I will have to keep these list elements until they are successfully save to the database.

    My problem is how can I update the List variable in the workflow to clear the elements once they are saved to the DB?

    I tried the BeginOnLoad and PublishValues override method in PersistentIOParticipant , but the variable is not present in the readWriteValues arguement.

    Could I manipulate the variable by listening to the Workflow loaded event and access the variable to remove the saved elements?

    Or, is there a better approach of handling the persistent of my list variable by respecting the the transaction of the workflow persistent?

    Any suggestion is greatly appreciated.

    Thanks.
    Alex Tan
     

    Wednesday, June 22, 2016 11:17 AM

Answers

  • Hi Alex,

    To access data to SQL persistent store. this might help you.

    Accessing Persisted Variables

    Regards,

    Angie


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Angie Xu Thursday, June 30, 2016 1:39 AM
    • Marked as answer by Angie Xu Thursday, June 30, 2016 1:39 AM
    Friday, June 24, 2016 9:03 AM