Workflow Tracking
Workflow Composer provides a visual workflow tracking feature that is built based on the workflow tracking infrastructure available in the .NET Framework. Workflow tracking enables you to observe the execution of a workflow instance at runtime.
-
Tracking records are emitted from a workflow at the workflow instance level and when activities within the workflow execute.
-
Tracking profiles are used to specify which tracking information is emitted for a workflow instance. The queries defined within the tracking profile section define the kinds of events that are returned by the subscription. For example, a tracking profile might subscribe to Started and Completed workflow event statuses. If no profile is specified, all tracking events are emitted. Tracking profiles are XML elements within a standard .NET framework config file. A Workflow Tracking Profile Editor UI is also available.
-
A workflow tracking participant needs to be added to the workflow host to subscribe to tracking records. The tracking participant subscribes to TrackingRecord objects. It contains the logic to process a TrackingRecord (for example, writing to a file). The .NET Framework provides an ETW (Event Tracing for Windows) tracking participant with a basic profile that is installed in the machine.config file. Anthology also provides an SQL tracking participant that stores the tracking records and permits retrieval of the tracking records.
For more information about the workflow tracking and tracing infrastructure in .NET, see https://learn.microsoft.com/en-us/dotnet/framework/windows-workflow-foundation/workflow-tracking-and-tracing.
Note:
Workflow tracking relies on three database strings that are configured in the configuration file for the ServiceModuleHost.exe. For more information, see Connection Strings.
dbConnection
WorkflowDurableInstancingConnection
WorkflowTrackingConnection
The dbConnection
and WorkflowDurableInstancingConnection
should point to the same SIS database, e.g., an Anthology Student database. The WorkflowTrackingConnection
should point to a specific tracking database (different than the SIS database).
The tracking process retrieves and displays data from the tracking database. If the tracking database is not configured, Workflow Composer will display a user friendly message. |
Workflow Tracking Example
After you have set up your environment for workflow tracking, use Workflow Composer for visual workflow tracking. You can:
- View workflows that are currently executing.
- View workflows that executed in the past.
- Select and replay workflows.
- Refresh the display in the Current and Historical windows.
You can troubleshoot a workflow and determine if it is executing properly based on the data being passed or returned from every activity step in a given workflow.
-
Open the Workflow Designer and click Open Tracked Workflow.
The Completed Workflows window is displayed. Each record indicates the following.
- Instance Id
- Workflow (.xaml file name)
- State (e.g., closed, executing, idle, unloaded, completed, aborted, terminated)
- Time
You can sort, filter, and rearrange the columns in the grids.
-
Select a record and click Open. The definition of the workflow instance is loaded into the Designer pane. You can select a workflow instance and click Replay to execute the workflow again, click Refresh to update the Completed Workflow instances, or click Close to unload the workflow from the Designer pane.
-
Click on the Workflow Activities tab below the Toolbox. The Workflow Activities pane is displayed. It contains records for the Activity steps in the currently loaded workflow.
-
In the Workflow Activities pane, click on the Activity step that you want to examine. The selected Activity step is highlighted in the Designer pane.
-
Click on the Debug Properties tab.
-
In the Debug Properties pane, click to the left of Workflow Activity State Data to inspect the details of the Arguments and Variables declared at the time of the execution of the Activity step selected in the Workflow Activities tab.
-
Click the icons to inspect the details of the Arguments and Variables declared at the time of the execution of the workflow Activity step selected in the Workflow Activities tab.
Notes:
-
Use the visual workflow tracking feature only when needed to avoid any performance impacts.
-
Define an appropriate tracking profile to limit the number of tracking records that are emitted at runtime.
For more information about tracking profiles, see https://learn.microsoft.com/en-us/dotnet/framework/windows-workflow-foundation/workflow-tracking-and-tracing. -
To clean up the Workflow Tracking database when it gets too large, refer to Resources > Workflow Tracking DB Cleanup Script.