Programme Step - Wait For
Programmes can be set to wait for an event to happen for the customer before continuing
It is similar to a wait until step, but it has additional functionality. Because it can also listen out for user events, it can, therefore, be allowed to 'wait indefinitely', which means that if the firing events never happen the programme would always be running.
How Long to Wait For
When using a JS / or a wait until static time type of wait on this step, you can also choose what should happen if these time frames are reached. For example, you may wish to STOP a programme if someone has NOT interacted with it by a certain time.
In the above example, the Time Function takes the programme data as a first parameter and module data from the data source: Booking Data Source as the second parameter (To learn more about Module Data, see Programme Modules). The function then uses a property of the module data 'timeUntilDeparture' to calculate the time to wait. This example function would ensure that the step would wait here until after the time of departure.
Reacting to Events
Another key feature of the wait for the step is the ability to set events that will trigger an action if they are raised. These actions are: Stop, Continue and Evaluate.
Stop and Continue Actions:
An example is represented in the image below. Events and corresponding actions can be selected. For example, the programme can be set to stop if a certain action occurs.
In another example, let's say I want to wait two weeks until a certain action is performed and then I want to stop this program once this action has been taken, then this can also be achieved using wait for.
In the above example, the function takes four parameters: the programme data, the event data, the customer and the module data. The module data is from the data source: Most Recent Data Source, specified under Module Data Class (To learn more about Module Data, see Programme Modules). The data passed into the function can then be checked for some condition to determine whether the action will be taken. In the above case, if the function returned true, the programme would continue, otherwise, it would continue waiting. This same logic can be applied to the stop action.