Building an Incident Support State Machine

In the world of customer support, it's generally impossible to know in advance all the rules to apply to a request. Many companies have tried to make the workflow as sequential as possible, with the use of phone-based routing and resolution of issues. However, in many (most?) cases, customer support calls require some amount of ad-hoc decision making by a human being.

In this next example, you'll build a state machine that will track a support call from an open to a closed state. Over the life of the support call, the incident will be in one of the following states (and no other states; nor will it ever be in an undefined state):

  • Call received

  • Assigned to phone resolution

  • Assigned to a service representative

  • Awaiting further information

  • Resolved

Your state machine will model these states and the transitions (edges) between them.

Let's get started. In Visual Studio 2008, choose File → New Project and create a State Machine Workflow Console Application. Name it CustomerSupportStateMachine, as shown in Figure 13-1.

You're not going to use Workflow1.cs, so you can delete that file. Then right-click on the project and choose Add → New Item. In the Templates area, choose "State Machine Workflow (with code separation)," as shown in Figure 13-2. Name the file CustomerService.xoml.

Creating the customer support state machine

Figure 13-1. Creating the customer support state machine

Figure 13-2. Adding ...

Get Programming .NET 3.5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.