Toggle menu

getQueryProcesses

Query the indexed process collection.

Parameters

NameTypeDescription
useQueryServiceBooleanThis should always be set to true. It is present for backwards compatibility and will be removed in a future release
filterObjectReturn process instances matching the provided filter
startNumber(Optional) Where to start the result set from, defaults to 0
limitNumber(Optional) How many results to return, defaults to 10
sortOrderArray<Object>(Optional) Enables multi-column ordering. For example [{"creationDate": "asc"}]. Available sort values: creationDate, processId, processIdLexical and description

Filter Keys

The following keys can be used when building filters to query indexed process instances.

NameTypeDescription
activeBooleanCan only have the value true. Set as true to only return active instances.
Only one of active or completed should be supplied. If neither are supplied, all instances may be returned
completedBooleanCan only have the value true . Set as true to only return completed instances.
Only one of active or completed should be supplied. If neither are supplied, all instances may be returned
assigneeStringUsers assigned to any of the process's tasks
candidateStringCandidate users for any of the process's tasks (Groups are automatically resolved)
startedByStringThe user who started the process
startedByProxyStringthe proxy user who started the process
involvedUserStringA user involved with the process
processDefinitionKeyStringThe definition key of the process
processIdStringThe process with the specific ID
businessKeyStringThe business key of the process
descriptionStringThe expanded description of the process
startedDateString (ISO8601)The started date of the process
completedDateString (ISO8601)The completed date of the process
suspendedBooleanWhether the process is suspended or not

Example

See the Filters article for further examples.

Request

This example fetches all active "feedback review" processes started by timg.

function(params, credentials) {
    let resp = this.callWorkerMethod("workflow", "getQueryProcesses", {
        "useQueryService": true,
        "filter": {
            "AND": [{
                    "key": "startedBy",
                    "EQ": "timg"
                }, {
                    "key": "processDefinitionKey",
                    "EQ": "feedbackreview"
                },
                {
                    "key":"active",
                    "EQ": true
                }
            ],
        }
    });
    return resp;
}

Response

Note that "processVars": {} only includes process variables that are set as searchable in the "summary form" used by the process instance (the summary form a process uses is named in the _summaryForm process variable). In most cases that will be the form that started the process instance, but a different form can be set on the Workflow - Start Action field.

{
    "list": [{
        "processVars": {
            "form_FEEDBACK": "Here's some feedback",
            "form_ISSUETYPE": "Error",
            "form_URL": "https://docs.gossinteractive.com/article/7747/getQueryProcesses"
        },
        "id": "240001",
        "processDescription": "Review comments from the feedback form",
        "type": "WorkflowProcessInstance",
        "businessKey": "5168-8848-3661-2384",
        "processDefinitionName": "Feedback Review",
        "processDefinitionKey": "feedbackreview",
        "processDefinitionId": "feedbackreview:5:92504",
        "startTime": "2022-02-18T15:08:40Z",
        "endTime": null,
        "tasks": [{
            "id": "240026",
            "taskDescription": "Review feedback for https://docs.gossinteractive.com/article/7747/getQueryProcesses",
            "assignee": "timg",
            "candidateGroups": ["staff"],
            "candidateUsers": [],
            "canUnclaim": true
        }],
        "messageDefinitions": {},
        "startUserId": "anonymous",
        "startProxyUserId": null,
        "parentBusinessKey": null,
        "parentProcessId": null,
        "suspended": false
    }],
    "count": 1,
    "time": 4,
    "debug": null
}

Last modified on August 01, 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon