<activityStateQuery>

Represents a query that is used to track life cycle changes of the activities that make up a workflow instance. For example, you may want to keep track of every time the "Send E-Mail" activity completes within a workflow instance. This query is necessary for a tracking participant to subscribe to activity state record objects. The available states to subscribe to are specified in ActivityStates.

For more information on tracking profile queries, see Tracking Profiles.

<configuration>
  <system.ServiceModel>
    <tracking>
      <trackingProfile>
        <workflow>
          <activityStateQueries>
            <activityStateQuery>

Syntax

<tracking>
  <trackingProfile name="Name">
    <workflow>
      <activityStateQueries>
        <activityStateQuery activityName="String" />
        <arguments>
          <argument name="String"/>
        </arguments>
        <states>
          <state name="String"/>
        </states>
        <variables>
          <variable name="String"/>
        </variables>
      </activityStateQueries>
    </workflow>
  </trackingProfile>
</tracking>  

Attributes and Elements

The following sections describe attributes, child elements, and parent elements.

Attributes

Attribute Description
activityName A string that specifies the name of the activity to filter ActivityStateRecord instances on.

Child Elements

Element Description
<arguments> A collection of arguments associated with this activity query.
<states> A collection of configuration elements that contain the states of the subscribed activity for which a tracking record should be emitted.
<states> A collection of variables associated with this activity query.

Parent Elements

Element Description
<faultPropagationQuery> Represents a list of configuration elements that are used to track requests to cancel a child activity by the parent activity. The query is necessary for a tracking participant to subscribe to cancel request record objects.

Remarks

One unique feature of an ActivityStateQuery is the ability to extract data when tracking the execution of a workflow. This provides additional context when accessing the tracking records post execution. You can use the <arguments>, <states> and <states> elements to extract any variable or argument from any activity in a workflow. The following example shows an activity state query that extracts variables and arguments when the activity’s Closed tracking record is emitted. Variables and arguments can be extracted only with an ActivityStateRecord and thus are subscribed to within a tracking profile using <activityStateQuery>.

<activityStateQuery activityName="SendEmailActivity">  
  <states>  
    <state name="Closed"/>  
  </states>  
  <variables>  
    <variable name="FromAddress"/>  
  </variables>  
  <arguments>  
    <argument name="Result"/>  
  </arguments>  
</activityStateQuery>  

See also