Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kogito BPMN : Unable to complete / POST to Embedded Subprocess' Human/User Task #3669

Open
karthikeyanga opened this issue Sep 18, 2024 · 0 comments

Comments

@karthikeyanga
Copy link

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

  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

1 participant