Monday, 15 February 2010

wpf - WF: Workflow Designer: List of InArgument added dynamically : How to get value during workflow execution -


I have created a workflow designer that allows to enter a list of email addresses. Each email in the list is an array of strings so that they can use edited / variable individually.

On my activity, I have a property that has been declared as follows:

  Viewable implementation (inrangement (string) ))  

This collection has been organized by my designer and this collection has been properly populated.

While performing the execution, I do not know how the run-time value was added for each in-instrument.

When we are executing workflow and iterating for each inragrade added to the list, I tried to get it as the value given below, but it failed:

  In the Arrangement (string of) for the adapter for each. To. The email address  string = toAddress.Get (_Context) for the slow email (<)  

The error we get is "type logic" & lt; type & Gt; "can not be used. It is an activity" that has been declared on and type is a string in my case ...

The error we understand in a way To be made because we have not declared a property on the activity it was dynamically linked to the list and it The value can not be obtained using the syntax given below:

  The_Property_Name.Get (_Context)  

Any help? I can not find anything, am I taking a different approach?

I know this because I will answer my question! Whatever we have to do, it explicitly adds the archive to the metadata by overriding the cache matadata () method on the activity. This then provides for workflow reference.

Before we add them to the context:

  Protected Override Sub Cache Metadata (Byval Metadata CodeActivityMetadata) MyBase.CacheMetadata (Metadata) I have a dim Integer = 0 as each Items in the form of InArgument (for the string) of me.To runTimeArg in RuntimeArgument = New RuntimeArgument ("to" & amp; i.ToString (), item.ArgumentType, item.Direction, false) metadata. Bind (Item, runTimeArg) metadata.AddArgument (runTimeArg) i = i + 1 next End Sub  

Then when we execute the values ​​like this

 < M> for each item InArgument (string = _Context.GetValue (items such as dim email Me.To as string)) Next  

No comments:

Post a Comment