/
GetProcessesByQuery Method

GetProcessesByQuery Method

First Added: GlobalCapture 2.3.0.124


Queries the MongoDB database for a list of Processes based on a query of combined ProcessFilters.

public List<Process> GetProcessesByQuery(List<ProcessFilter> query, QueryOperator queryOperator)

Classes: Database


Parameters

List<ProcessFilterquery

List of ProcessFilters combined to make a single query.

QueryOperator queryOperator

Logical operator used to connect the filters of the query.

Returns

List<Process>

List of process objects.


Example

The following example demonstrates combining executing a complex query by combining a few ProcessFilters in a list, and passing that list to the GetProcessesByQuery function. This particular query will return GlobalCapture processes from the workflow named "Example Workflow", that have a status of validation, and that have a name property of "John".

var query = new List<ProcessFilter>
{
    new PropertyFilter("Name", "John", PropertyComparator.Equals),
    new WorkflowNameFilter("Exasmple Workflow"),
    new StatusFilter(ProcessStatus.Validation),
    new ProcessTypeFilter(ProcessType.GlobalCapture)
};
return databaseHelper.GetProcessesByQuery(query, QueryOperator.And);

Remarks

If the parameters result in zero Processes found, an empty list will be returned.

Related content

GetProcessesByWorkflowName Method
GetProcessesByWorkflowName Method
More like this
GetProcessesByStatus Method
GetProcessesByStatus Method
More like this
GetProcessesByProperty Method
GetProcessesByProperty Method
More like this
QueryOperator Enum
QueryOperator Enum
More like this
ProcessTypeFilter(ProcessType) Constructor
ProcessTypeFilter(ProcessType) Constructor
More like this
ProcessTypeFilter Class
ProcessTypeFilter Class
More like this