locked
Mapped variables and promoted values: What does "mapped" mean? RRS feed

  • Question

  • Hi,

    I'm trying to get an understanding of the activity variable modifieres, e.g. Mapped and ReadOnly. Right now I'm stuck with the "Mapped" modifier as I don't see when to use it and what the effects of this modifier are. Can anybody explain the variable behavior for variables with the modifier "mapped" enabled?

    Somewhere on these forums I've read that you need to map variables in order to be able to promote them. Doesn't look like that's the whole truth as I tested the example from here http://blogs.msdn.com/b/asgisv/archive/2010/05/11/collecting-business-values-from-appfabric-for-analytics.aspx and got promoted variables to work without specifing "Mapped". This is especially true as per the example you need an activiy which does the variable handling, therefore you do not even use variables during promotion, instead you use the values of the InArguments of the activity which uses the extension to set the promoted values.
    In addition I have looked at the MapValues() function and the same is true for this. As long as I promote my variables with the corresponding participant everything works as written before (no mapping, special activity for promotion, ...).

    Looks like I'm missing something and promotion might get far easier if I eventually understand the concept of mapped variables ("variable" like in variable for the root SequenceActivity). Right know I have to provide 3 classes, 1 activity and an extended AppFabric schema just for promoted values.

    So, what does the "mapped" modifier do for variables?

    Kind regards,
     - tobias

    Thursday, March 24, 2011 12:21 PM

Answers

  • Hi,

    When you persist your workflow, the variables are stored in a serialized blob in the database.  If you deserialize the blob, it's not very readable. With variables marked as "Mapped", they can be stored in a human readbale format. This will cause a Location variable to be passed into the WriteOnlyVariables parameter of the MapValues function.  You can iterate through the Xname values and find the Location variables to find your mapped variable. The Location contains the name, value and parent scope of the variable.

    For more information, you can refer to http://social.msdn.microsoft.com/Forums/en/wfprerelease/thread/3cd6cb14-0d6a-4944-933a-3af5c526b87b

    Regards,

    Panda


    This posting is provided "AS IS" and confers no rights or warranties.
    • Marked as answer by TobiasM Tuesday, March 29, 2011 6:55 AM
    Saturday, March 26, 2011 12:48 PM

All replies

  • Hi,

    When you persist your workflow, the variables are stored in a serialized blob in the database.  If you deserialize the blob, it's not very readable. With variables marked as "Mapped", they can be stored in a human readbale format. This will cause a Location variable to be passed into the WriteOnlyVariables parameter of the MapValues function.  You can iterate through the Xname values and find the Location variables to find your mapped variable. The Location contains the name, value and parent scope of the variable.

    For more information, you can refer to http://social.msdn.microsoft.com/Forums/en/wfprerelease/thread/3cd6cb14-0d6a-4944-933a-3af5c526b87b

    Regards,

    Panda


    This posting is provided "AS IS" and confers no rights or warranties.
    • Marked as answer by TobiasM Tuesday, March 29, 2011 6:55 AM
    Saturday, March 26, 2011 12:48 PM
  • Hi Panda,

    thanks for your help. Didn't read the writeOnlyValues part in the posting you've referred to and was looking in readWriteValues of MapValues instead.

    Kind regards,

    Tobias

    Tuesday, March 29, 2011 7:04 AM