Previous page | Process Management | Next page |
Background execution |
Actions are normally executed synchronously. This means that they are completed before the user is taken to the next page
However, where the actions may take too long to complete (ie long enough to provide the user with a poor experience), it is desirable to return the user to their post-submission page immediately, and execute the actions in the background, asynchronously:
To set an action to be executed in the background:
Notes: You can add multiple actions as children of the Background object You can have a combination of synchronous and asynchronous actions in the same event tree In the example above, "Update Field A" and "Update Field D" are executed synchronously, and then the post-submission page is returned to the user. 'Update Field B', 'Update Field C' and 'Send Email' are executed in the background. By definition the system does not provide any guarantee of when the background tasks will be executed. They are placed in a queue for execution 'as soon as possible'. Where the flow that a user is taken through requires that the background actions have been executed, it is best to set a flag field when the actions are completed, and place the user in a refresh loop testing for the flag status every few seconds. (For example, you often see this in airline booking systems)
Comparison with the Delay object The 'Background' object is functionally equivalent to a 'Delay' object with the delay is set to execute 'Now'. Both return immediately, and then execute child actions as soon as possible thereafter.
|
|