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 (OnPremises, PrivateCloud)

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

URL Format (OnDemand)

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

Request Parameters

Name Description
None Not Applicable

Request Body Properties

Name Description

expr

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

ColumnName

Function:
Gets and sets the associated database column name.
Type
string
Accepted Values:
A valid database column name.

Operator

Function:
Specifies the operator used for comparison.
Type
int
Accepted Values:
A valid operator.

IsValue

Function:
Gets and sets the flag that indicates if it compares a value or column of the table.
Type
bool
Accepted 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: "mydomain\\brian.lucas", IsValue: true
  };
  $.ajax({
    url: "https://mydomain:9011/AgilePointServer/Workflow/QueryProcInsts",
    data: JSON.stringify(JSONObject)
  });
  
});

Java Code Example

public String QueryProcInsts() {

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

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

  JSONObject postData = new JSONObject();
  
    postData.put("ColumnName", "PROC_INITIATOR");
    postData.put("Operator", "EQ");
    postData.put("WhereClause", "DMEO3\\Administrator");
    postData.put("IsValue", "true");
    return ops.POSTMethod(URI, postData.toString());
  return "";
}

C# Code Example

public string QueryProcInsts()
  {
    string URI = "https://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);
  }

cURL Code Example

Note: The authorization code is an example. You must generate your own authorization code in base64 encoded format with the syntax Domain\Username:Password.
curl --header "Content-Type: application/json" 
                         --header "Authorization:Basic QVAtNDI0XEFkbWluOnBhc3M=" 
                         --request POST 
                         --data {\"ColumnName\":\"PROC_INITIATOR\",
                         \"Operator\":\"EQ\",
                         \"WhereClause\":\"mydomain\\brian.lucas\",
                         \"IsValue\":\"true\"} 
                         https://mydomain:9011/AgilePointServer/Workflow/QueryProcInsts

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": "mydomain\\brian.lucas",
  "ProcInitiatorLoc": "?",
  "ProcInstID": "00131C75A35046A89E32B64C4649E075",
  "ProcInstName": "e-Signature-3847DEA4715F4A8A830D4C9973A521E5",
  "ProcessInitiator": "mydomain\\brian.lucas",
  "ProcessInitiatorLocation": "?",
  "SourceProcInstID": "",
  "StartedDate": "\/Date(1385676471217+0000)\/",
  "Status": "Completed",
  "SuperProcInstID": "",
  "TargetProcInstID": "",
  "Version": "1.23",
  "WorkObjectID": "5C56CADC7CB74C9DA596CC149834BD81",
  "WorkObjectInfo": ""
}]

Supported Versions

AgilePoint v5.0 R2 and higher

Code Examples in the AgilePoint NX Documentation

The AgilePoint NX Product Documentation is intended as a basic reference to help you understand how to complete basic coding tasks, such as make API or JavaScript method calls. Code examples that show specific use cases, the solutions to specific business problems, or detailed implementation scenarios are outside the scope of the AgilePoint NX Product Documentation. For specific and/or advanced types of examples that may better meet your requirements, AgilePoint provides several resources:

  • AgilePoint Community Forums - A free, AgilePoint-moderated, crowd-sourcing user forum where you can ask questions about specific techniques, the solutions to use cases, workarounds, or other topics that may not be covered in the Product Documentation.
  • Professional Services - If you can not find the information you need for your specific business problem, mentoring is available through AgilePoint Professional Services.
  • Personalized Training - AgilePoint can provide personalized training for your organization. To request personalized training, contact AgilePoint Sales.