In the below code snapshot we have made a simple XOML sample. Below is the explanation number wise:-
1 – In order to create a XOML file you need to add sequential workflow with separation. Which means that XOML file will be created with a behind code.
2 – Currently we have two activity code3 and code1.
Below is the XOML file contents: -
<?Mapping XmlNamespace="Activities" ClrNamespace="System.Workflow.Activities"
<Code ExecuteCode="Mycode3" ID="code3" />
<Code ExecuteCode="Mycode1" ID="code1" />
See the above snippet of the XOML file. You can see how the behind code is linked using the Compile With attribute. Code forms the element of the Sequential Workflow tag. One of the best thing with Markup is we can change the sequence just by changing the XOML file we do not need to compile the whole application again.
In the above snapshot, one of the things to now is 3, 4, and 5 numbered sections. These sections are not linked with the sample. But just to make you aware you can create serialize any workflow and deserialize them again using the text writer object.
Also see following WWF(Windows Workflow Foundation) interview questions video on sample working of Windows Workflow Foundation(WWF): -