We are encountering an issue on getting the task availa ble of certaing group. I

We are encountering an issue on getting the task availa ble of certaing group. In one user group, the members of that group have an action to get the next available task available for that group , clicking on that action, we make a query check the next unassigned task, assigne that to that user & then update DB but now the issue, tha is tasking place is when two users click on the same time. The same task is being fecthed b y both users. One user overwrite the other user in Appian but in DB, it is te foirst tat is tsill updated. So now, when user to whome , it is assigned in DB, see s that task in his name in DB, he/she tries to access it but as in Appian, the task is assigned to another user, they gets an error that requested task is not available. Can anyone suggest a solution for this please?

OriginalPostID-147706

OriginalPostID-147706

  Discussion posts and replies are publicly visible

Parents
  • Here goes one of the possible ways to overcome race condition if you are making a query on database:

    To the best of my knowledge, if you do as follows, the race condition can be eliminated:

    Instead of depending on database for checking the task status, depend on any one of the following options in order to check the status of the task:
    1. getportalreportdatasubset (plugin)
    2. queryProcessAnalytics function (OOTB)
    3. Execute portal report OOTB smart service (OOTB)

    Opting for any one of the options will get you the most recent data. For example, let's assume that a task is assigned to user. At the same time when some other user tries to get the same task and if you query the status of the task using process analytics data, within fraction of seconds you can get the updated data. (Where as in case of DB, you could observe some lag time between capturing the status, updating the same in database and querying the status in parallel in case of other users, which thereby leads to race condition.) Perform the database updates still if desired, but I would like to suggest to depend on process analytics for calculating the task availability.

    Please do let me know if you have any follow up questions.
Reply
  • Here goes one of the possible ways to overcome race condition if you are making a query on database:

    To the best of my knowledge, if you do as follows, the race condition can be eliminated:

    Instead of depending on database for checking the task status, depend on any one of the following options in order to check the status of the task:
    1. getportalreportdatasubset (plugin)
    2. queryProcessAnalytics function (OOTB)
    3. Execute portal report OOTB smart service (OOTB)

    Opting for any one of the options will get you the most recent data. For example, let's assume that a task is assigned to user. At the same time when some other user tries to get the same task and if you query the status of the task using process analytics data, within fraction of seconds you can get the updated data. (Where as in case of DB, you could observe some lag time between capturing the status, updating the same in database and querying the status in parallel in case of other users, which thereby leads to race condition.) Perform the database updates still if desired, but I would like to suggest to depend on process analytics for calculating the task availability.

    Please do let me know if you have any follow up questions.
Children
No Data