# Teknical Specification for Human Task **Task Creation Logic**: - Logic to generate a new task instance with initial property values when the subflow is initiated. **Role-Based Access Control**: - Tasks are visible based on user roles, with permissions to view and claim tasks. **Auto-Transaction Mechanism**: - A service monitors tasks with autoTransaction enabled and updates status after autoTransactionTimeout. **Backend Services**: - Services handle task persistence, status updates, and role-based filtering, interacting with Zeebe via client APIs. **Zeebe Worker Configuration**: - Custom Zeebe workers manage the lifecycle of human tasks, creating and updating tasks in the list. ## BFF Services for Human Task ### Query Human Task by User - **Endpoint**: (https://test-pubagw6.burgan.com.tr/ebanking/humantask/user) - **Method**: GET - **Description**: Retrieves tasks assigned to a user. #### curl curl --location 'https://test-pubagw6.burgan.com.tr/ebanking/humantask/user?assignee=62959326822' \ --header 'User: 650c0ab5-7e1d-4d06-a7ce-f75e6857da68' \ --header 'Behalf-Of-User: 650c0ab5-7e1d-4d06-a7ce-f75e6857da68' \ --header 'Accept-Language: en-EN' \ --header 'Authorization: Bearer eyJhbGciOiJIUzM4NCIsInR5cCI6IkpXVCJ9.eyJzY29wZSI6InJldGFpbC1jdXN0b21lciIsInVzZXIucmVmZXJlbmNlIjoiNjI5NTkzMjY4MjIiLCJ1c2VyLmlkIjoiODc5MzYyNzctYTI5MC00M2U5LWI0ODItMTMzMDk0M2VhYzE3IiwiY29uc3RfdmFsIjoieHl6IiwiY3VzdG9tZXJfbm8iOiIyMDE4NjM3NyIsInVzZXJuYW1lIjoiNjI5NTkzMjY4MjIiLCJuYW1lIjoiNjI5NTkzMjY4MjIiLCJnaXZlbl9uYW1lIjoiUmVtemkiLCJmYW1pbHlfbmFtZSI6IkthbmF0IiwiYnVzaW5lc3NfbGluZSI6IlgiLCJjbGllbnRfaWQiOiJJYkFuZHJvaWRBcHAiLCJlbWFpbCI6Im9iaXJlbEBidXJnYW4uY29tLnRyIiwicGhvbmVfbnVtYmVyIjoiOTA1MzQ1NzY4ODQ2Iiwicm9sZSI6IkZ1bGxBdXRob3JpemVkIiwiY3JlZGVudGlhbHMiOlsiSXNJbnRlcm5ldEN1c3RvbWVyIyMjMSIsIklzQW5vbnltb3VzIyMjMSJdLCJhenAiOiIzZmE4NWY2NC01NzE3LTQ1NjItYjNmYy0yYzk2M2Y2NmFmYTYiLCJ1cHBlcmNhc2VfbmFtZSI6IlJFTVrEsCIsInVwcGVyY2FzZV9zdXJuYW1lIjoiS0FOQVQiLCJsb2dvbl9pcCI6IjE5Mi4xNjguMTAyLjE0MyIsImp0aSI6ImYwNTJkMzBiLWIzMDgtNGY0ZS1hMjA5LTNlNmI0ZDZiMWVkNCIsInVzZXJJZCI6Ijg3OTM2Mjc3LWEyOTAtNDNlOS1iNDgyLTEzMzA5NDNlYWMxNyIsImlhdCI6IjE3MTY4OTgxNzEiLCJleHAiOjE3MTY4OTg1MzEsImlzcyI6IkJ1cmdhbklhbSIsImF1ZCI6IjNmYTg1ZjY0LTU3MTctNDU2Mi1iM2ZjLTJjOTYzZjY2YWZhNiJ9.nnQPcHHZ9JPTZ0-2WcA7uT7dIwk0opVCzqnlovYOoX20Pu5MIjWmMWwy56BTbCeU' \ --header 'Cookie: 482e2bced14b876c139e02eaa6e68fe3=0b8c9c659bf46d047f6c5db66296249a; d765907c0cd58c256b4df03b591a1a44=172567b4b40516dd29a8d6ad3aea9738' \ --data '' #### Example Response [ { "taskId": "9a3b3a93-2d59-4c96-b683-22a63222cdf3", "name": "SubFlowTestFromUserRegister", "description": "x Nolu Onayınız", "status": 1, "type": 1, "assignee": "62959326822", "roles": null, "createdBy": null, "createdAt": "2024-05-28T15:07:59.041242+03:00", "dueBy": "2099-05-01T20:38:00+03:00", "priority": 0, "instanceId": "4c235e77-3957-426f-a1a4-bfddc682ef11", "autoTransaction": false, "autoTransactionTimeout": 0, "state": "user-approval", "appTransitionName": "user-registration-approve", "denyTransitionName": null, "autoTransitionName": "user-registration-approve", "metadata": null } ] ### Query Human Task by Status - **Endpoint** https://test-pubagw6.burgan.com.tr/ebanking/humantask/status/{status} - **Status** => pending,completed,denied - **Method**: GET - **Description**: Retrieves tasks by status #### curl curl --location 'https://test-pubagw6.burgan.com.tr/ebanking/humantask/status/pending?assignee=62959326822' \ --header 'User: 650c0ab5-7e1d-4d06-a7ce-f75e6857da68' \ --header 'Behalf-Of-User: 650c0ab5-7e1d-4d06-a7ce-f75e6857da68' \ --header 'Accept-Language: en-EN' \ --header 'Authorization: ••••••' \ --header 'Cookie: 482e2bced14b876c139e02eaa6e68fe3=750f524241dd97a84ac99dfe4d6c7199; d765907c0cd58c256b4df03b591a1a44=271ee734259467fc998e3d98b4177758' \ --data '' Optinal parameter "InstanceId" Example Response { "metaDataHumanTask": null, "lastEntityData": null, "lastAdditionalData": null, "statusString": "pending", "isOwned": true, "taskId": "fefd78f6-2568-4fbd-9f56-be5a077d68b6", "name": "SubFlowTestFromUserRegister", "description": "x Nolu Onayınız", "status": 1, "type": 1, "assignee": "1234567891440", "assigneeList": [ "1234567891440" ], "roles": null, "createdBy": null, "createdAt": "2024-06-26T18:00:56.467985+03:00", "dueBy": "9999-12-31T23:59:59.9999999", "priority": 0, "instanceId": "b6e96217-4864-430c-a976-218a4b4e1440", "autoTransaction": false, "autoTransactionTimeout": 0, "state": "user-approval", "appTransitionName": null, "denyTransitionName": null, "autoTransitionName": null, "metadata": null, "claimBy": null, "claimDueDate": null } ] ## BPMN Implementation ![image](https://hackmd.io/_uploads/Sy3PRS7NC.png) If you want to add HumanTask Sub Flow to your bpmn you can add CallActivity with ProcessID => "HumanTaskSubFlow" ### Input Values ![image](https://hackmd.io/_uploads/SJEEv3nqR.png) #### humanTaskName Task Name #### humanTaskAssignee Task Assigned Person In Example task assigned to person who start to transition #### humanTaskAssigneeList Task Assigned Persons In Example task assigned to persons who start to transition (Array) #### humanTaskState Human Task State #### humanTaskDesc Human Task Description #### humanTaskNotification values it can take Message or Push-Notification. Sending Push Notification or Message to person who triggered to transition value #### humanTaskRoles Task Assigned Roles In Example task assigned to roles who start to transition ### Output Values #### IsApprove if Human Task Approve then true else false #### humanTaskMessageValue =LastTransition Last triggered transition value