DCSIMG
CacheMetadata in Flowchart activities - Manu Cohen-Yashar's Blog

Manu Cohen-Yashar's Blog

CacheMetadata in Flowchart activities

I was building some custom activities which use dynamic arguments.

Dynamic arguments are created on runtime based on the values of some of the activities properties. The code that creates the arguments is called by visual studio designer and it is written in the activity's CacheMetadata(NativeActivityMetadata metadata) method as well as in the activity designer code-behind.

When I used my custom activities inside a sequence workflow everything worked great but when I used them in a flowchart workflow dynamic arguments where not created.

I started to debug this and found out that in a flowchart workflow CacheMetadata is called by visual studio designer only when an activity is connected to other activities in the flowchart or when an argument is set.

It is not called when you drag an activity from the toolbox to the workflow like happens in a sequence workflow. 

This must be known to the workflow developer and taken into consideration when she builds the workflow. To create dynamic arguments the workflow developer must do the following:

  1. Drag an activity to the workflow
  2. Set its properties
  3. Connect the activity to the write place in the flowchart
  4. Double click it and set the dynamic properties just created

Hope this helps

Manu

Comments

No Comments

Leave a Comment

(required) 

(required) 

(optional)

(required) 


Enter the numbers above: