Tracking _ query User-Defined statuses

Source: Internet
Author: User

User-Defined State object: UserTrackingRecord

User-Defined State object: UserTrackingRecord is stored in the UserEvents set of SqlTrackingWorkflowInstance as a set Member

For details about how to add user-defined states, see [Tracking _ Adding User-Defined states to Tracking in Activty (4)].

(CODE)
It is not required in the WorkflowRuntime Host Program

Private static void to get the user status (System. Guid instance Id)
{
String SQL = @ "Initial Catalog = Tracking; Data Source = WXWINTER \ SQLEXPRESS; Integrated Security = SSPI ;";
SqlTrackingQuery query = new SqlTrackingQuery (SQL );
The instance that SqlTrackingWorkflowInstance is queried;
Query. TryGetWorkflow (instance Id, out instance to be queried );

Foreach (UserTrackingRecord user status in the instance to be queried. UserEvents)
{
Console. writeLine ("========================================" );
Console. WriteLine ("Activity:" + User status. QualifiedName );
Console. WriteLine ("Activity type:" + User status. ActivityType. ToString ());
Console. WriteLine ("context ID:" + User status. ContextGuid. ToString ());
Console. WriteLine ("time:" + User status. EventDateTime. ToString ());
Console. WriteLine ("content:" + User status. UserData. ToString ());
Console. WriteLine ("EventOrder field value:" + User status. EventOrder. ToString ());
Console. WriteLine ("Parent context ID:" + User status. ParentContextGuid. ToString ());
Try {Console. WriteLine ("key-Value Pair:" + User status. UserDataKey. ToString ());}
Catch {Console. WriteLine ("this does not have a key-value pair! ");}

Console. WriteLine ();
}
}

Running result

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.