karthikeyanga opened a new issue, #3669:
URL: https://github.com/apache/incubator-kie-kogito-runtimes/issues/3669

   Description:
       We are using kogito postgres as the persistence layer for the runtime. 
In some cases after a restart we were unable to POST / complete a user task for 
a which was  created before the restart. We were getting the output as 
   ```{ "taskId": "27d10aa3-514f-470c-9b87-b6cb1d1ecece", "message": "Work Item 
(27d10aa3-514f-470c-9b87-b6cb1d1ecece) does not exist" }```
   After some trouble shooting we found that we were able to get the task 
details in both the GET tasks and GET all by task id too. And the above error 
happens only during POST call for any change in the task. 
   Also we noted that this error is happneing only in case of User tasks in 
Embedded Process of the main Process.
   
   
   How to reproduce:
   
   - Create a kogito runtime(1.43.0.Final) with postgres persistance enabled
   
   - Create a BPMN (simple.bpmn2) with a human task and then an embedded 
process with a human task as shown in the picture below 
   
![simple-svg](https://github.com/user-attachments/assets/a8185d40-8342-42ea-9fd5-d307799a5b8c)
   
   - Build and run the Kogito runtime 
   - Start the work flow (either in the swagger or via the curl as follows)
   ```
   curl -X 'POST' \
     'http://localhost:7000/simple' \
     -H 'accept: application/json' \
     -H 'Content-Type: application/json' \
     -d '{
     "request": {}
   }'
   ```
   This should have created two tasks for the process (Get the tasks for the 
process)
   ```
   curl -X 'GET' \
     'http://localhost:7000/simple/<processIntance Id>/tasks' \
     -H 'accept: application/json'
   ```
   Sample tasks created
   ```
   [
     {
       "id": "42bf5587-ed6d-4741-bf43-96d357fa8b03",
       "name": "MTask",
       "state": 0,
       "phase": "active",
       "phaseStatus": "Ready",
       "parameters": {},
       "results": {}
     },
     {
       "id": "07cec0f8-0b2c-4492-aa77-f011509b99d0",
       "name": "STask",
       "state": 0,
       "phase": "active",
       "phaseStatus": "Ready",
       "parameters": {},
       "results": {}
     }
   ]
   ```
   PS: MTask is the user tasks in the main process while STask is the user task 
in the embedded sub task.
   
   -  Now restart the serivce by killing the process and rerunning the 
application
   - Now get tasks for the process instance again, it should show both MTask 
and STask.
   ```
   curl -X 'GET' \
     'http://localhost:7000/simple/<processIntance Id>/tasks' \
     -H 'accept: application/json'
   ```
   
   - A POST call on the STask would fail
   ```
   curl -X 'POST' \
     
'http://localhost:7000/simple/<ProcessInstanceId>/STask/<SubprocessTaskIs>?phase=complete'
 \
     -H 'accept: application/json' \
     -H 'Content-Type: application/json' \
     -d '{}'
   
   ```
   would yield
   `{ "taskId": "<STaskId>", "message": "Work Item (<STaskId>) does not exist" 
}`
   
   while if this was repeated for the MTask it would succeed 
   
   Fixes required:
   Please refer
   
https://kie.zulipchat.com/#narrow/stream/232676-kogito/topic/Embedded.20Subprocess'.20Human.20Task.20reconnect.20Fail.20after.20resart
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to