Is there a way to terminate a process if a user closes the browser tab/window?

In our case management system, we have a process which - 

  • Is run as a quick task
  • Every UI node in the process has an exception timer
  • When a user launches an action related to a case, the case gets 'locked' to the process initiator and no other user can edit the same case if it is being edited by another user

However, we have users who repeatedly end up using the browser tab/window close functions if they want to 'x' out of the task they are in. The process continues to run in the background until the timeout is hit and other users who might need to make edits are locked out of the system until the previous process times out. Is there a solution/what are my options to terminate a process if a user closes the browser window? 

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer
    For quick tasks, the thing I've ended up doing most often is to designate a particular expression rule to generate the task timeout time. The case I always want to avoid at all costs is where a user is sitting on a form for a long time, i.e. entering information etc, and when they finally hit "Submit", the timer has fired in the background and they lose all their work (this has happened to me more than once while submitting a detailed support case update on Appian Support).

    Back to the expression rule - what I decided works best is to set the time to a point in the future where it's unlikely that the user is still logged in on their current session (or at all) - such as 1 AM [overnight] the next calendar day. I don't believe such a thing is able to be accomplished via a constant, which is why I just go ahead and use a rule, i.e. "APN_generateOvernightTimeout()", etc.

    Unfortunately this doesn't help much in the case of a user accidentally / intentionally closing out of the quick task early. If that's a primary concern, my main suggestion would be then to make the task NOT a quick task, so that the user doesn't lose it (and get locked out) if they close / switch away from the task.
  • 0
    Certified Senior Developer
    in reply to Mike Schmitt

    Hi Mike,

    We have a similar use case to configure the timeout at Process level to terminate if the user no longer using the task or left the task tab or closed the task opened browser.

    Kindly provide the logic implemented in the above mentioned expression rule "APN_generateOvernightTimeout()" should provide the one day after the task has been initiated like you specified.

    Our use case:

    • If the user edits the task, works on it, and close the browser: auto save the progress and close out the task.
    • if the user edits the task, works on it, and leaves it open for a prolong period of time: auto save the progress and close out the task.

    Your expertise is very much helpful to implement the same.

    Thanks in advance.

  • 0
    Certified Lead Developer
    in reply to ramp

    Appian does not provide a way to implement the two use cases you describe. For process start forms, you could provide a button to "Save Progress" that submits and somehow saves the state. For in-process user input tasks, you could just use the "Save Draft" feature.

Reply Children
No Data