Find Instances of All Processes |
Scroll |
The TheQuery class can also be used to find all running and/or finished instances of all workflow processes. The guide and code sample below teach you how to do that. The reference page of the GetAllWorkflowInstances method contains more details on parameters and usage.
If you want to get all instances of just one workflow processes the ExecuteWorkflowQuery method described in the "Find Instances of a Specific Process" guide.
1 |
Connect to the Thereforeā¢ server (see "Server - Connect and Disconnect" for Details) |
2 |
Declare and initialize a new TheQuery. |
3 |
Call GetAllWorkflowInstances to run the query on the server. |
4 |
Optional. Display the results in a MessageBox. |
Visual Basic Imports Therefore.API '...
' 1. Connect to the Thereforeā¢ server Dim server As New TheServer server.Connect(TheClientType.CustomApplication)
' 2. Create a new query Dim wfQuery As New TheQuery
' 3. Execute the query on the server Dim wfResult As TheMultiQueryResult = wfQuery.GetAllWorkflowInstances( _ TheWorkflowFlags.AllInstances, server)
' Optional 4. Display the results in a messageBox System.Windows.Forms.MessageBox.Show(wfResult.ToString())
C# using Therefore.API; //...
// 1. Connect to the Thereforeā¢ server TheServer server = new TheServer(); server.Connect(TheClientType.CustomApplication);
// 2. Create a new query TheQuery wfQuery = new TheQuery();
// 3. Execute the query on the server TheMultiQueryResult wfResult = wfQuery.GetAllWorkflowInstances( TheWorkflowFlags.AllInstances, server);
// Optional 4. Display the results in a messageBox System.Windows.Forms.MessageBox.Show(wfResult.ToString()); |