camunda-bpm-platform icon indicating copy to clipboard operation
camunda-bpm-platform copied to clipboard

Tasklist Filter displays the Task Input Variables as Undefined despite them having values

Open psavidis opened this issue 8 months ago • 0 comments

Environment (Required on creation)

  • The behaviour has been reproduced with camunda-bpm-run-ee-7.20.5-ee
  • The Relevant support ticket mentions Camunda Platform 7.18.x, Camunda Platform 7.20.x

Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket)

Given a Tasklist filter with two variables (FNAME, LNAME)

  • When a bpmn file (SUPPORT-21936-2.bpmn) is deployed with an Expanded SubProcess with the two variables as inputs, the filter demonstrates them correctly. ✔

  • When a second version of the above file (SUPPORT-21936_Output.bpmn) is deployed and a test output variable is added inside a user task, the filter displays the two variables as undefined ✘

Screenshots

1. Screenshot with two Local Variables - SUPPORT-21936-2.bpmn

Screenshot 2024-05-29 at 1 10 24 PM

2. Screenshot with two Local Variables and one Output Variable - SUPPORT-21936_Output.bpmn

Screenshot 2024-05-29 at 1 10 51 PM

3. Screenshot with Filter Variables that are Undefined

Screenshot 2024-05-29 at 1 10 51 PM

Steps to reproduce (Required on creation)

Create Filter

    1. Go to Tasklist, click on the Create a filter+ option on the top left corner
    1. On the General tab, give the Filter a name e.g My Filter
    1. Click on the Variables tab and tick the Show Undefined option
    1. Add two variable entries: a) Name: FNAME, Description: First Name b) LNAME, Description: Last Name
    1. Click Save

Deploy and View Filter Works

    1. Deploy SUPPORT-21936-2.bpmn to process-engine and start a process-instance (e.g using the desktop-modeler )
    1. Go to the Tasklist page, click on My Filter, notice how test task displays the variable First Name and Last Name populated with date test data.

Deploy and View Filter is Broken

    1. Deploy SUPPORT-21936_Output.bpmn to process-engine and start a process-instance (e.g using the desktop-modeler)
    1. Go to the Tasklist page, click on My Filter, notice how the second test task (top of the list) does displays undefined values for First Name and Last Name variables

Observed Behavior (Required on creation)

SUPPORT-21936_Output.bpmn process-instance creates a test task with local variables (2 input, 1 output) which should be displayed in the Tasklist filtered list view. Instead, the variables are displayed as Undefined.

Expected behavior (Required on creation)

The Tasklist View should display First Name and Last Name Filter Variables of the test task related to SUPPORT-21936_Output.bpmn with a populated value instead of Undefined

Root Cause (Required on prioritization)

The endpoint /camunda/api/engine/engine/{engine-name}/filter/{filter-id}/list which is used to visualise the filter:

  • Returns the Input variables for the process-instances of the first deployable (SUPPORT-21936-2.bpmn)
  • Does not return the input variables and the output variable for the second deployable (SUPPORT-21936_Output)
  • FilterResourceImpl#convertToHalTaskList Line 405
    • The getVariableInstancesForTasks call returns a map with variable entries ONLY for the task with two input variables; the task which includes the output variable is not returned.

Solution Ideas

Hints

  • When the user clicks on the test task (any of the two created), claims the task and clicks on the Load Variables option, the input variables FNAME and LNAME are returned successfully by the respective API
    • API used for the above operation: camunda/api/engine/engine/{engine-id}/task/{task_id}/form-variables?deserializeValues=false)

Links

  • https://jira.camunda.com/browse/SUPPORT-21936

Breakdown

### Pull Requests

Dev2QA handover

  • [ ] Does this ticket need a QA test and the testing goals are not clear from the description? Add a Dev2QA handover comment

psavidis avatar May 30 '24 14:05 psavidis