Browse by Tags
All Tags »
WF 4.0 (
RSS)
One of the major missing parts in windows azure was the support for workflow. You could install a workflow on a web role but when multiple instances of the web role try to persist and load the same workflow instance an exception is thrown. Workflow was designed to run by a single host that persist its state to a single database. This concept does not fit to the cloud that uses multiple computing instances by design. Azure AppFabric provides the solution. A whole new host was developed especially...
Bookmark is a simple mechanism for asynchronous triggering provided by Workflow 4.0. In a NativeActivity we create a bookmark and wait. In the host ( WorkflowApplication ) we resume the bookmark and continue execution. I think that the mechanism is too simple. For example: What about timeouts? Well it is impossible to set a timeout and limit the time the workflow will wait on the bookmark. I found a solution by creation a custom activity which wraps the activity that owns the bookmark and use...
Adding a custom toolbox icon to your custom activity is a simple task yet there are few rules to follow. To add the custom Icon we use ToolboxBitmap Attribute. like so: [ ToolboxBitmap ( typeof ( MyActivity ), "myIcon.bmp" )] public sealed class MyActivity : NativeActivity The icon "myIcon.bmp" must be a bitmap file The icon must be 16X16 pixels The icon must be compiled as embedded resource in the current assembly To display a custom icon in the designer you have to write the...
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. Well… 1. When the input value is needed before the activity is executed, for example in the CacheMetadata method - CLR properties are your only...
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...
Almost every activity has arguments. The workflow designer presents only the root activity's arguments (these are the "Workflow Arguments") The activity's arguments has to be binded to ExpressionTextbox placed on the activity canvas (i.e. The Activity designer). When your activity is static and is completely defined in xaml there is no problem to define the binding in the xaml definition of the activity designer (there are tons of examples).The question is what happens when arguments...
In Workflow 4.0 it is easy to return values. All you have to do is create a set of out arguments and provide the arguments with values. The values will be available in a dictionary in the WorkflowApplicationCompletedEventArgs parameter of the Completed handler. There is one simple step that is often being forgotten, that is to create an instance of the value to return. If the OutArgument is of type string (or other primitive) all you have to do is set the string value to the argument...