Alfresco / alfresco-ng2-components

Alfresco Angular Components
https://www.alfresco.com/abn/adf/docs/
Apache License 2.0
295 stars 264 forks source link

Save Form incorrectly saves variable set in the complete event #6455

Closed tdonovancsra closed 3 years ago

tdonovancsra commented 3 years ago

Type of issue: (check with "[x]")

  • [ ] New feature request
  • [ X] Bug
  • [ ] Support request
  • [ ] Documentation

Current behaviour: Starting with version 3.9 of ADF. When a process contains code in a org.activiti.engine.impl.bpmn.listener.ScriptTaskListener When the user saves the form via the save button instead of completing the form. The variable in the script task is being saved to the SAVED_FORM table in the json with no value. If the value is of type FormFieldType.PEOPLE this causes the api to have null pointer exception and you cannot load the form again. I null check there would be nice as well but the real problem is the variable shouldn't be saved there to begin with.

Expected behavior: When the form is saved to the SAVED_FORM table the variable should not be passed down to be saved by ADF.

Steps to reproduce the issue: Create process with a step with user input.
Create script task and on the completed event save a variable task.getExecution().setVariable('requestAssignee', task.getAssignee()) Open the task and save the task (don't complete) re-load the task.
the API will send a 500 error on null for that variable.

Component name and version: "@alfresco/adf-core": versions 3.9.0 to 4.2.0

Browser and version: All

tdonovancsra commented 3 years ago

+1

tdonovancsra commented 3 years ago

I hope this isn't being thought of as an API issue from my description above and not being looked at. The problem appears in the api but the issue is that the JSON generated from the ADF client code is incorrect.

dhrn commented 3 years ago

Hello @tdonovancsra

I couldn't reproduce this. can you give me the sample BPMN app ?

tdonovancsra commented 3 years ago

@dhrn Did you try on ADF 4.2 or 4.3?

eromano commented 3 years ago

https://alfresco.atlassian.net/browse/ADF-5373

VitoAlbano commented 3 years ago

Hi @tdonovancsra we tried with the latest ADF and it seems fine, could you share a BPMN example app?

tdonovancsra commented 3 years ago

Hey looks like ADF 4.5 fixes the issue. I tested 3.9-4.4 and it was still broken but something fixed it in 4.5. I'm a results person so fine with me tho curious what it was ;). Closing the issue