Custom Workflow Activity – Property or Argument

7 בנובמבר 2010

tags: , ,
one comment

In WF 3.5 custom activity input was written to properties. The developer who would use these activities would set values to properties directly in the designer or using binding.

In WF 4.0 it is possible continue to use regular CLR properties or to use Input Arguments exposed as properties.

The question is when to do what.


1.       When the input value is needed before the activity is executed, for example in the CacheMetadata method – CLR properties are your only option. Input Arguments are visible only with a context object provided in the Execute method. I had a project where I wanted to create arguments on the fly using information supplied by the WF developer. This could only be achieved using CLR properties as dynamic arguments are created in  CacheMetadata.

2.       If the value needs to be persisted it must be contained in an Argument because the activity's CLR properties are NOT persisted. (It is always possible to use a persistence participant to solve this problem)

3.       CLR properties cannot be set in the designer property pane with an expression. Only simple kind of types can be set (for example: System.Type)

I hope these considerations will help …


Add comment
facebook linkedin twitter email

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


one comment

  1. במאי 2013 ב 6:48

    The more mineral water and 2 day diet pills 2 day diet pills sodium people lose in your perspiration, the greater the amount of standard water is released in the fluids outside of your cells, enhancing your weightloss.