(German version maybe coming later / deutsche Version folgt eventuell später)
This post is a continuation of my intro to BizTalk Workflow Services.
When orchestrating anything or in more simple words, when implementing an algorithm, we typically need a type of flow control. What is the order of the commands? How do we set conditions? How do we repeat something? This also is necessary when wanting to run an algorithm in the cloud. We are using BizTalk Workflow Services to describe what we want to do in the cloud. The tool we have are workflow activities.
BizTalk Workflow Services have a limited set of flow control activities:
- CloudIfElse (and CloudIfElseBranch )
This does not seem much, but together with a place to store your data it theoretically lets people implement all types of algorithms.
CloudIfElse (and CloudIfElseBranch ) work very much like their regular equivalents. However, remember that those activities are in fact a new implementation and are not identical to IfElse or IfElseBranch.
Practically you will have to remember when setting rules, that you can only use declarative rule conditions (stay tuned in some days for a post about declarative rule conditions). Trying to use a code condition in the CloudIfElseBranch will result in this:
The CloudIfElse activity needs a minimum of one cloudIfElseBranches but can have more than 2:
You can add a branch:
That branch will be always added to the right:
Notice that now cloudIfElseBranch2 displays an error (exclamation mark in red circle) because we did not set a condition on the cloudIfElseBranch2 yet. The error did not display earlier, because the last CloudIfElseBranch in fact does not need a condition to be set. The CloudIfElseBranches' conditions are evaluated from the left to the right.
If we do not like the position of a CloudIfElseBranch , we can change their position with the help of the context menu easily:
We move it to the left, so we expect the cloudIfElseBranch2 (and it's red exclamation mark circle) now to be on the very left side:
The CloudWhile activity is again the cloud version of the regular While branch. And this neat activity is at the same time the reason for the CloudSequence activity. The CloudWhile activity only allows one inner child activity to be repeated. So, what you need is a Sequence activity. However, currently you cannot use a non-cloud activity in a cloud-based workflow.
Even though as we have seen in my previous post the cloud-workflow itself is a SequenceActivity, it cannot contain a SequenceActivity but needs a CloudSequence activity instead.
Trying to use a non-cloud activity will result in the following validation error when trying to save the XOML in the web-form:
The workflow failed validation
- Type System.Workflow.Activities.SequenceActivity, System.Workflow.Activities, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31bf3856ad364e35 is not marked as authorized in the application configuration file.
This makes a CloudWhile with more than one activity to look like this:
In one of the next posts I will look at the other activities and a bit deeper into the conditions you can use.
A little "disclaimer": Some readers wondered why I explain very simple things here. My reasoning is that I expect completely new users to want to get started with cloud technologies without digging through the workflow foundation's fundamentals first. They will want to look at the workflow foundation's basics soon enough anyways. But it could be overwhelming for new readers and people interested in BizTalk Services to have to know too much before getting started. I aim at giving people an easier start.
Aug 09 2008, 03:49 AM
Filed under: .NET 3.0, BizTalk, BizTalk Server, .NET 3.5, BPM, Workflow, WF, Cloud Computing, Cloud, BizTalk Services, Cloud Services