<trackingProfile>WCF 的<trackingProfile> of WCF

表示一个配置节,用于创建对跟踪参与者中的工作流跟踪记录的订阅。Represents a configuration section for creating a subscription to workflow tracking records in a tracking participant. 跟踪配置文件包含跟踪查询,这些查询允许跟踪参与者订阅当工作流实例的状态在运行时发生更改时发出的工作流事件。A tracking profile contains tracking queries that permit a tracking participant to subscribe to workflow events that are emitted when the state of a workflow instance changes at runtime. 跟踪配置文件节中定义的查询用于定义订阅返回的事件类型。The queries defined within the tracking profile section define the kinds of events that are returned by the subscription.

有关工作流跟踪及其配置的详细信息,请参阅工作流跟踪和跟踪跟踪配置文件For more information in workflow tracking and its configuration, see Workflow Tracking and Tracing and Tracking Profiles.

<configuration>
  <system.serviceModel>
    <tracking>
      <profiles>
        <trackingProfile>

语法Syntax

<system.serviceModel>
  <tracking>
    <profiles>
      <trackingProfile name="String">
        <workflow activityDefinitionId="String">
          <activityScheduledQueries>
            <activityScheduledQuery activityName="String"
                                    childActivityName="String" />
          </activityScheduledQueries>
          <activityStateQueries>
            <activityStateQuery activityName="String">
              <arguments>
                <argument name="String" />
              </arguments>
              <states>
                <state name="String" />
              </states>
              <variables>
                <variable name="String" />
              </variables>
            </activityStateQuery>
          </activityStateQueries>
          <bookmarkResumptionQueries>
            <bookmarkResumptionQuery name="String" />
          </bookmarkResumptionQueries>
          <cancelRequestedQueries>
            <cancelRequestedQuery activityName="String"
                                  childActivityName="String" />
          </cancelRequestedQueries>
          <customTrackingQueries>
            <customTrackingQuery activityName="String"
                                 name="String" />
          </customTrackingQueries>
          <faultPropagationQueries>
            <faultPropagationQuery faultSourceActivityName="String"
                                   faultHandlerActivityName="String" />
          </faultPropagationQueries>
          <stateMachineStateQueries>
            <stateMachineStateQuery activityName="String" />
          </stateMachineStateQueries>
          <workflowInstanceQueries>
            <workflowInstanceQuery>
              <states>
                <state name="String"/>
              </states>
            </workflowInstanceQuery>
          </workflowInstanceQueries>
        </workflow>
      </trackingProfile>
    </profiles>
  </tracking>
</system.serviceModel>

特性和元素Attributes and Elements

下列各节描述了特性、子元素和父元素。The following sections describe attributes, child elements, and parent elements.

特性Attributes

属性Attribute 说明Description
namename 一个字符串,指定跟踪配置文件的名称。A string that specifies the name of the tracking profile.

子元素Child Elements

元素Element 描述Description
<participants> 一个配置元素,包含 ProfileWorkflowElement.ActivityDefinitionId 属性所标识的特定工作流的所有查询。A configuration element that contains all queries for a specific workflow identified by the ProfileWorkflowElement.ActivityDefinitionId property.

父元素Parent Elements

元素Element 描述Description
<tracking> 表示一个配置节,用于定义工作流服务的跟踪设置。Represents a configuration section for defining tracking settings for a workflow service.

注解Remarks

跟踪配置文件包含跟踪查询,这些查询允许跟踪参与者订阅当工作流实例的状态在运行时发生更改时发出的工作流事件。Tracking profiles contains tracking queries that permit a tracking participant to subscribe to workflow events that are emitted when the state of a workflow instance changes at runtime. 根据您的监视需求,可以编写一个非常粗陋的配置文件,用来订阅对工作流进行的一小组高级状态更改。Depending on your monitoring requirements you may write a profile that is very coarse, which subscribes to a small set of high-level state changes on a workflow. 相反,也可以创建一个非常具体的配置文件,其生成的事件足够丰富,可在以后重新构造详细的执行流。Conversely, you may create a very specific profile whose resulting events are rich enough to reconstruct a detailed execution flow later.

跟踪配置文件组织为跟踪记录的声明性订阅,利用这些订阅可以查询特定跟踪记录的工作流运行时。Tracking profiles are structured as declarative subscriptions for tracking records that allow you to query the workflow runtime for specific tracking records. 有几种查询类型允许您订阅不同的 TrackingRecord 对象类。There are a handful of query types that allow you subscribe to different classes of TrackingRecord objects. 有关查询的完整列表,请参阅 <participants>跟踪配置文件For a complete list of queries, see <participants> and Tracking Profiles.

下面的示例演示配置文件中的跟踪配置文件,该配置文件允许跟踪参与者订阅 StartedCompleted 工作流事件。The following example shows a tracking profile in a configuration file that allows a tracking participant to subscribe to the Started and Completed workflow events.

<system.serviceModel>
  <tracking>
    <profiles>
      <trackingProfile name="Sample Tracking Profile">
        <workflow activityDefinitionId="*">
          <workflowInstanceQueries>
            <workflowInstanceQuery>
              <states>
                <state name="Started" />
                <state name="Completed" />
              </states>
            </workflowInstanceQuery>
          </workflowInstanceQueries>
        </workflow>
      </trackingProfile>
    </profiles>
  </tracking>
</system.serviceModel>

另请参阅See also