Stop! I want to get off.


I remember many years ago being at a theme park and all strapped in to start a rollercoaster ride. No sooner had we left the station than someone started screaming: he had decided that he didn't want to go on the ride.

The ride stopped halfway up the first rise. The systems were checked, the screaming continued, and everything was deemed safe to proceed. So off we went. When we returned to the station, one man departed the station very quickly.

Many of the scripts you write simply start, run, and finish. But some are more complex and will take more time to run. In those cases, a user may want to stop the process—perhaps it is taking too long, or they have accidentally run the wrong report.

How do we handle the user wanting to stop? As with most things, the best answer is "it depends."

With the roller coaster ride the operators had three options:

  1. Let the man out and have him make his way back to the station.
  2. Reverse the carriages back into the station and let him out.
  3. Continue the ride to its normal conclusion and let him out.

A script can have similar options. But once it has started, stopping it safely means considering its current state and restoring the appropriate starting state. In practice, that may mean undoing changes already made.

The number and type of changes will depend on both the script’s process and how far it has progressed when it is stopped.

Over the next few days, we’ll look at some example scripts and ways to handle a request to stop.


Are you coming to Reconnect.Christchurch, 15-16 October?
Get all the details and purchase tickets at Reconnect.Christchurch.

Are you late to the ScriptLogic party? If you have missed out on some of these emails, catch up here: Email Archive

If you know someone else who you think might like this email, you can send them this link to subscribe: Subscribe to ScriptLogic Daily