2 Replies Latest reply on Oct 29, 2018 4:29 AM by Nikhil Mehta

    Filter Spec / Body in REST api of Query Definition with Filtered Data

    Nikhil Mehta Newbie

      Hello,

       

      I am trying to get data using Query Definition and for that I have created query definition using following rest api.

      Type : POST

      URL :   /server/queries/definitions/{queryName}

      Params :

      queryName  : getAllTaskInputInstancesWithVariables

      body : 

      {

        "query-source" : "java:jboss/datasources/jbpmDS",

        "query-expression" : "select ti.*, tv.name tvname, tv.value tvvalue from AuditTaskImpl ti inner join (select tv.taskId, tv.name, tv.value from TaskVariableImpl tv where tv.type = 0 ) tv on (tv.taskId = ti.taskId)",

        "query-target" : "CUSTOM"

      }

       

      Query Definition is successfully created with following response.

       

      {

        "query-name" : "getAllTaskInputInstancesWithVariables",

        "query-source" : "java:jboss/datasources/jbpmDS",

        "query-expression" : "select ti.*, tv.name tvname, tv.value tvvalue from AuditTaskImpl ti inner join (select tv.taskId, tv.name, tv.value from TaskVariableImpl tv where tv.type = 0 ) tv on (tv.taskId = ti.taskId)",

        "query-target" : "CUSTOM",

        "query-columns" : {

          "PROCESSSESSIONID" : "NUMBER",

          "CREATEDON" : "DATE",

          "WORKITEMID" : "NUMBER",

          "TVVALUE" : "LABEL",

          "PRIORITY" : "NUMBER",

          "ACTUALOWNER" : "LABEL",

          "NAME" : "LABEL",

          "ACTIVATIONTIME" : "DATE",

          "TASKID" : "NUMBER",

          "PROCESSINSTANCEID" : "NUMBER",

          "STATUS" : "LABEL",

          "PARENTID" : "NUMBER",

          "DESCRIPTION" : "LABEL",

          "DEPLOYMENTID" : "LABEL",

          "LASTMODIFICATIONDATE" : "DATE",

          "TVNAME" : "LABEL",

          "ID" : "NUMBER",

          "CREATEDBY" : "LABEL",

          "DUEDATE" : "DATE",

          "PROCESSID" : "LABEL"

        }

      }

       

      I am trying to get data with filtered query. for that I am using following query and data.

      Type : POST

      URL/server/queries/definitions/{queryName}/filtered-data

      Params :

      queryName : getAllTaskInputInstancesWithVariables

      mapper : UserTasksWithVariables

      builder : [blank]

      page : 0

      pageSize : 10

      body/QueryFilterSpec: ?

       

      Here I am not sure which content required as a body to get response based on specific parameter names and value. I also have tried some parameters like java API but unfortunately I didn't get output.

      It is optional field but to get specific data we must pass that information.


      Can anyone help me out what I need to put in body/QueryFilterSpec to get specific data based on that parameter name and value?

       

      Your efforts are appreciated. Thanks in advance.