Поделиться через


Tracking Profile Designer Sample

Download sample

The Workflow Tracking Profile designer is a tool to support the creation of tracking profiles from workflow definitions by using the workflow designer surface. This sample application assumes that you are familiar with tracking profiles and services. For more information, see the references at the end of this topic.

To build the sample

  1. Download the sample by clicking Download Sample in this topic.

    This extracts the sample project to your local hard disk.

  2. Click Start, point to Programs, point to Microsoft Windows SDK, and then click CMD Shell.

  3. Go to the source directory of the sample.

  4. At the command prompt, type MSBUILD <Solution file name>.

To run the sample

  1. In the SDK Command Prompt window, run the .exe file in the TrackingProfileDesigner\bin\debug folder (or the TrackingProfileDesigner\bin folder for the VB version of the sample), which is located below the main folder for the sample.

Creating Tracking Profiles

Follow these procedures to add and configure activity track points and open tracking profiles.

To create an activity track point

  1. On the File menu, click Open, and then click Workflow From File.

  2. Navigate to the assembly that contains the workflow that you want to use, and then click Open to return to the Workflow Tracking Profile Designer main screen.

  3. On the designer surface, click an activity to select it.

    This enables the Track button on the toolbar.

  4. Click Track to track the selected activity.

To configure an activity track point

  1. Click Events to select the activity status event that you want to track for the selected track point.

    You can select all or none of the events by clicking Select All or Select None.

  2. Click Annotate to open an Annotation tool strip.

  3. In the text box, enter a string to describe the activity track point.

  4. Click Extract Data, and select Properties in the list to choose the elements that will be tracked for this activity.

  5. Select Match Derived Types to indicate that this track point will match the selected activity type and all derived types.

  6. You can also add conditions to filter the set of emitted track points.

To add a tracking condition

  1. Click Conditions on the selected activity track point and select Add new condition.

  2. In the Conditions tool strip, select the member that will appear on the left side of the condition, for example, Name.

  3. Click the == button to toggle between equality and inequality (!=).

  4. Enter a string value for the right side of the condition, for example, codeActivity1.

  5. Click Save to add the completed condition.

To open tracking profiles

  1. On the File menu, click Open, and then click Profile From File.

  2. Select the tracking profile file to use and then click Open .

Note

A workflow must be loaded before a tracking profile can be opened. Additionally, only profiles that are generated with this tool are guaranteed to be loaded correctly.

To save tracking profiles

  1. On the File menu, click Save, and then click Profile as File.

  2. Enter a path and file name using the .xml extension.

  3. Click Save to save the tracking profile.

Using the SQL Tracking Database

If you have a SQL tracking database set up, you can also save your profiles to the database. If you have not yet created the tracking database, refer to the database setup instructions in the Simple Tracking Sample.

To use the application with the SQL tracking database

  1. Update the application's .config file with a valid ConnectionString to the profile database.

    The default configuration file looks like the following:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <appSettings>
            <add key="ConnectionString" value="Persist Security Info=False;Integrated Security=SSPI;database=TrackingStore;server=localhost"/>
        </appSettings>
    </configuration>
    
  2. On the File menu, click Save, and then click Profile to SQL Tracking Database to save the current profile to the tracking database.

    If the version in the database is later than the current profile, a dialog box appears and requests a later version before the profile is saved.

  3. On the File menu, click Open, and then click From SQL Tracking Database to load a profile from the tracking database.

    A dialog box appears and enables you to select a workflow type and a profile version. If the workflow assemblies are not in the same path as the designer, another dialog box appears and requests the location of the required assemblies.

Remarks

  • Because this application is a sample, there are certain limitations with its use:

  • Only tracking profiles that are created by the profile designer are guaranteed to load correctly. This is because the designer creates and assumes that a single activity-tracking location will exist for a particular track point.

  • Tracking profiles are saved per workflow type. To save a profile as the default tracking profile, you can call the stored procedure UpdateDefaultTrackingProfile.

  • Annotations appear only for outermost composite activities.

  • You cannot add UserTrackPoints using the designer.

See Also

Other Resources

Creating and Using Tracking Profiles
Windows Workflow Tracking Services
Creating Custom Tracking Services
File Tracking Service and Query Sample
Task 4 : Using the Windows Workflow Tracking Service
Application Samples
Windows Workflow Foundation Samples

© 2007 Microsoft Corporation. All rights reserved.