1 Reply Latest reply on Nov 5, 2014 5:56 AM by Maciej Swiderski

    Accessing task/process instance variables and filtering tasks with REST API

    Łukasz Dwórski Newbie

      Hi,

       

      In project which I'm participating we would like to display tasks on custom grid and we need some custom values which are not available using REST API.

      We decided to extend REST API with operation that will fetch custom variables and can filter tasks with these values.

       

      Can you tell what is the standard way to get task's variables?

      I know about existence of the VariableInstanceLog table, but it looks rather like history table - this is the only table I found that stores something similiar to things I'm looking for, it seems

      like process instance variables, but in most cases, in our project, they will be equals to task's variables.

       

      When using VariableInstanceLog it will be also a problem to filter tasks if we want to use filtering with more than 1 of our custom variable -

      joining Task with VariableInstanceLog will return no results since in VariableInstanceLog every row contains single variable.

       

       

      Can anyone needed to expand tasks query rest API to fetch custom variables and filter tasks using it? What is the recommended way to do it?

       

       

      I will be grateful for any help,

      Łukasz

        • 1. Re: Accessing task/process instance variables and filtering tasks with REST API
          Maciej Swiderski Master

          if you consider extension to the api recommended way would be to use the variable that you want to filter by to include in the name or description so then you don't need to go over task variables but simply to check it's name or description. That way queries will be fast and efficient and allow you to still rely on variables. Example can be found here where comment is set with process variable which will actually end up as task description.

           

          As you noticed correctly variable instance log keeps only process variables so that can be an alternative solution to first fine process instances and then by their ids find tasks.

           

          HTH