locked
PersistenceIOParticipant and remove nonserializable arguments RRS feed

  • Question

  • I would like to add an extension to my workflows that automatically sets any non serializable arguments of a certain type to null, adds a variable that knows some metadata about the argument (ie it's primary key) to the workflow, and upon resuming reloads the argument.  In theory I know how to do it, but outside of the debugger I don't seem to be able to access the arguments.  The readWriteValues[workflow Xname] seems to be an internal class (ActivityExecutor) and I can use reflection to get to the DynamicActivity [we load our definitions from a database], but the challenge is getting to the value itself.

    When poking around with reflection I can see DynamicActivity has the item I am after as an InArgument<T>, but I am unable to get to its value to set it to null.  I looked in CollectValues, MapValues and BeginOnSave.  

    Is this possible to do so I can make persistence seamless and effective for non serializable items?

    Thanks,

    John

    Tuesday, June 28, 2011 3:28 PM

Answers

  • Hi, John

    ->"Is this possible to do so I can make persistence seamless and effective for non serializable items?"
    The simpliest solution is implementing a PersistenceParticipant and store your own data some where else, for example, you can create another database which is for storing your data and querying only.

    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 Thursday, July 7, 2011 2:08 AM
    Monday, July 4, 2011 8:37 AM