none
How to change a property value at Runtime

    Question

  • Hi all,

    I am trying to design an activity that is intelligent enough to make decisions at runtime based on certain database variables that a workflow designer will add at design time. Here is what I've done,

    • Since database variables need to be added at design time, these are defined as a Collection Property.
    • Each database variable in the collection is a structure that contains
    1. Database Path
    2. Table name
    3. Variable Name
    4. Variable Type
    5. Variable Value
    Now, in order to make decisions at runtime, I have to access the database and update the "Variable Value" of each database variable defined in the collection. Using ActivityContext, I can access the runtime values of Arguments and Variables but I don't know how to access and change a Property value at runtime. Please help..
    Friday, July 22, 2011 5:30 AM

Answers

  • Hi,

    ->" I can access the runtime values of Arguments and Variables but I don't know how to access and change a Property value at runtime. Please help.."
    You can create a custom activity to update the data. The custom activity query the database and get the data you want. then assign to an OutArgument. in the workflow designer, you assign the value of OutArgument to an Variable of parent workflow. so that the data in workflow is updated.

    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
    Thursday, July 28, 2011 7:52 AM
    Moderator