How can we pass parameters to workflow?

When you call the startworkflow function you can pass as name / value pairs using the dictionary object.

What is the use of XOML files? Twist: – How can we serialize workflows?

Windows Workflow Foundation gives developers a declarative way to create workflows by using XAML. See WPF chapter for more details about XAML. These markup files are stored with XOML (Extensible Object Markup Language) extension. In the below snapshot you can see Workflow1.xoml file created by designer. Markupfile can also have code behind. The whole concept of having code behind for XOML file is to separate the presentation from logic files.

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 More >

How do you handle exceptions in workflow?

Exception handling in Workflow is somewhat different than how we do in normal .NET application. Below is the numbered snapshot of how we can handle exceptions in Workflow.

1 – We have small tab which says view exceptions. If you click on view exception you will be redirected to a workflow design only for exception as shown in numbered snapshot 2.

2 – This is the workflow which will execute incase we have exceptions. We have put a code activity which points to a method called as raiseException. Incase of exception in the workflow this path will be followed.

More >

When should we use a sequential workflow and when should we use state machines?

If the workflow is very rigid then you go for sequential workflow and if the workflow is dynamic then go for State machine workflow. For instance you have placed an order and the order will not pass until your supervisor approves is a rigid flow. Because your order has to be approved by a supervisor or else it will not be approved. But if your order moves from one place to other place. For instance it moves from approval to waiting and then clarification a state machine work flow model is more appropriate.

Below is a simple code snippet which shows More >

What are different types of Workflow in Windows Workflow foundation?

There are two basics type of workflow Sequential Workflow and State machines workflow.

A sequential workflow has clear start and finish boundaries. Workflow controls execution in Sequential workflow. In sequential execution one task is executed after other. Sequential workflow is more rigid in format and execution path has a determistic nature.

A State machine workflow is more dynamic in nature. Basically workflow has states and the state waits for events to help it move to next state. In State machine execution path is undetermestic nature.

Below figure shows visual conceptualization of fundamentals. You can see in Sequential work flow the execution path is More >

What is a Workflow?

A Workflow is a set of activities which is stored as model and they depict a process. Below figure depicts clearly the difference between Workflow and Activity. Every task is an activity and group of activity depicts a complete workflow. Workflow is run by the Workflow runtime engine.

What is Windows Workflow Foundation?

WWF is a programming model for building work flow enabled applications on windows. System.WorkFlow namespace has all the necessary modules to develop any type of work flow.

Can you explain how we can separate code and XAML?

This is one of the most important features of WPF, separating the XAML from the code to be handled. So designers can independently work on the presentation of the application and developers can actually write the code logic independent of how the presentation is.

What are the kind of documents are supported in WPF?

There are two kind of major document supported in WPF Fixed format documents and Flow format document. Fixed format documents are like PDF format. They display content regardless of screen size and resolution. But flow format document adjust depending on screen size and resolution.

Below is the code snippet for fixed format. You can see the document has a look of PDF reader. Step 1 defines the tag to define a document and Step 2 shows how the document looks.

How can we access XAML objects in behind code?

To access XAML objects in behind code you just need to define them with the same name as given in the XAML document. For instance in the below code snippet we named the object as objtext and the object is defined with the same name in the behind code.