Query Process Instances

API Type

REST

HTTP Method

POST

Description

Retrieves a list of process instances that match a specified query expression. The WFQueryExpr string is used to generate a query expression, and the client application specifies the query terms.

URL Format (On Premises)

https://[domain]:[port]/AgilePointServer/Workflow/QueryProcInsts

URL Format (AgilePoint for Azure)

https://[domain]:[port]/AgilePointService/Workflow/QueryProcInsts

Request Parameters

Name Description
None Not Applicable

Request Body Properties

Name Description

expr

Definition:
Specifies the where clause of a SQL query expression.
Type
WFQueryExprHelper
Allowed Values:
A valid WFQueryExpr object.

ColumnName

Definition:
Gets and sets the associated database column name.
Type
string
Allowed Values:
A valid database column name.

Operator

Definition:
Specifies the operator used for comparison.
Type
int
Allowed Values:
A valid operator.

IsValue

Definition:
Gets and sets the flag that indicates if it compares a value or column of the table.
Type
bool
Allowed Values:
  • True - It compares a value or column of the table.
  • False - It does not compare a value or column of the table.

JavaScript Code Example

$("#btnQueryProcInsts").click(function () {
  
  var JSONObject = {
    ColumnName: "PROC_INITIATOR", Operator: "EQ", WhereClause: "demo3\\brian.lucas", IsValue: true
  };
  $.ajax({
    url: "https://mydomain:9011/AgilePointServer/Workflow/QueryProcInsts",
    data: JSON.stringify(JSONObject)
  });
  
});

Java Code Example

public String QueryProcessInstances(String ColumnName, 
  String Operator,
  String WhereClause, boolean IsValue) {

  String URI = "http://mydomain:9011/AgilePointServer/Workflow/QueryProcInsts";

  HTTPOperations ops = new HTTPOperations(domain, this.userName,
                       password, appID, locale);

  JSONObject postData = new JSONObject();
  try {
    postData.put("ColumnName", ColumnName);
    postData.put("Operator", Operator);
    postData.put("WhereClause", WhereClause);
    postData.put("IsValue", IsValue);
    return ops.POSTMethod(URI, postData.toString());
  } catch (JSONException e1) {
    e1.printStackTrace();
  }
  return "";
}

C# Code Example

public string QueryProcInsts()
  {
    string URI = "http://mydomain:9011/AgilePointServer/Workflow/QueryProcInsts";

    var jsondata = "{
      \"ColumnName\":\"PROC_INITIATOR\",
      \"Operator\":\"EQ\",
      \"WhereClause\":\"MYDOMAIN\\\\administrator\",
      \"IsValue\":true}";
    
    HTTPOperations ops = new HTTPOperations(domain, this.userName, 
                         password, appID, locale);

    return ops.POSTMethod(URI, jsondata);
  }

Output

An array of WFBaseProcessInstance objects. It returns null if nothing matches to the query expression.

JSON Response Body Example

[{
  "ApplName": "MyApplication",
  "CompletedDate": "\/Date(1385676516500+0000)\/",
  "DefID": "9D85E1670FBB46A98A9A2C042CDB02C5",
  "DefName": "e-Signature",
  "DueDate": "\/Date(1386281220000+0000)\/",
  "LastModifiedBy": "",
  "LastModifiedDate": "\/Date(1385676471207+0000)\/",
  "LastRunningEndTime": "\/Date(1385676516510+0000)\/",
  "LastRunningStartTime": "\/Date(1385676516483+0000)\/",
  "LastSwapDate": "\/Date(928149600000+0000)\/",
  "ProcInitiator": "demo3\\brian.lucas",
  "ProcInitiatorLoc": "?",
  "ProcInstID": "00131C75A35046A89E32B64C4649E075",
  "ProcInstName": "e-Signature-3847DEA4715F4A8A830D4C9973A521E5",
  "ProcessInitiator": "demo3\\brian.lucas",
  "ProcessInitiatorLocation": "?",
  "SourceProcInstID": "",
  "StartedDate": "\/Date(1385676471217+0000)\/",
  "Status": "Completed",
  "SuperProcInstID": "",
  "TargetProcInstID": "",
  "Version": "1.23",
  "WorkObjectID": "5C56CADC7CB74C9DA596CC149834BD81",
  "WorkObjectInfo": ""
}]

Supported Versions

AgilePoint BPMS v5.0 R2 and higher