List tasks an display the process key / business process key on a table

Hello.
Im trying to make a list of tasks that havent been assigned and have a user come claim them
I can list the tasks but I can’t display the process instance on the view. I need to do something like an inner join between these lists… i might do a big loop or just use a native SQL for this.

Is it possible to display a variable value on a column?

List processInstances = bprocRuntimeService.createProcessInstanceDataQuery()
// .processDefinitionKey(“order-approval”)
// .variableValueEquals(“orderId”, order.getId()).list();

    //LIST TASKS
    List<TaskData> tasks = bprocTaskService.createTaskDataQuery()
            .orderByTaskCreateTime()
            .desc()
            .list();

image

thank you for the continued support

Hi,
The easiest solution will be to add generated columns to the table. Column generators should load process definition key, process instance business key, process variables and so on. This will not require writing custom SQL but may require additional database requests.

The second solution, as you said, is writing custom SQL code that will join all required database tables. You may do it using standard CUBA mechanisms or try to leverage MyBatis mappings described in the Flowable documentation. In this case you’ll need to deal with displaying custom SQL query results in UI.

Thank you for your reply. I figured… I pretty much queried both lists and got a few field that I need.
If I were to use column generators could I do a datamanager.load entitites for every row?

You can write any code inside the column generator. Please clarify your question if I don’t get what you need.