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

  • As far as I know, there is no way in Appian to respond to the event of a browser window/tab being closed, so exception timers may be your only solution. Depending on your use case, you could provide users with the ability to break other users' locks (similar to how Appian lets designers break other user's locks on expressions), which will mitigate the problem but will not solve it completely.
  • You're best option to mitigate if a user abandons a process that needs to be closed out is to put a timer with a condition defined either on a task or the whole process. However, I do highly recommend that you document these exception timers that will terminate the process. I've seen in projects over time where multiple timers are set out throughout the application with different timers associated with them (15mins, 30mins, 45mins) with no overarching rule governing them all. In your case, utilize constants to have consistency in your termination flows, and document their locations so that the support team knows the impact of this.
  • Definitely a good idea to document time-outs like this. It's also good to take it a step further and use a single global constant to configure these time-outs to further ensure consistency and to allow for easy modification of the time-out for all processes.

  • 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.