holunda-io / camunda-bpm-taskpool

Library for pooling user tasks and process related business objects.
https://www.holunda.io/camunda-bpm-taskpool/
Apache License 2.0
67 stars 26 forks source link

Provide task list filter criteria #843

Closed mmiikkkkaa closed 3 weeks ago

mmiikkkkaa commented 1 year ago

Scenario

Polyflow collects many information about tasks and process related variables, which often represent data of the workpiece, which is handled by a process. Users are using tasklists, to find the tasks they should work on. Since these tasklists can get quiete long in some environments, the users might want to be able to filter the tasklists by some properties from the workpieces, simply to narrow down the tasks to some few. e.g. filtering a list of "index book into library system" tasks by a specific book author, so they don't need provide different author information for each task, but can use the same information for a complete batch of books.

Current Behaviour

Polyflow keeps track of values from the process variables (and also other sources of information), but doesn't provide an overview of existing values, which could be used for filter autocompletion.

Wanted Behaviour

Distinct values from process variables should be provided via an API, so tasklists can use them for filtering the tasks. Since tasklists are mostly used via group assignments, those values might be provided together with the assigned authorization.

This should be configurable, so only needed values are provided, respectively not needed and maybe impractical values (e.g. timestamps) are not sent.

Possible Workarounds

By now also a view can be created, collecting the values from plf_task_payload_attributes and plf_task_authorizations tables:

select distinct 
    `payload`.`path`                                     AS `attribute_name`,
    `payload`.`value`                                    AS `attribute_value`,
    replace(`auth`.`authorized_principal`, 'GROUP:', '') AS `user_role`
from (`plf_task_authorizations` `auth` join `plf_task_payload_attributes` `payload`)
where `auth`.`task_id` = `payload`.`task_id`
order by `payload`.`path`