Warning Constraint Example: Scheduling Tours to Unstable Destinations

Previous Next

See Also

The Travel Agency schedules tours to many exotic destinations. Sometimes, a destination is not considered to be stable, politically or economically. It is not recommended then to schedule a tour to this destination. However, it is the participant that decides whether to take the risk.

1. Define a new message categorie, and do not select the System check box:

Category: Constraint Warning

2. Define a new system message:

Code:    1

Category:    Constraint Warning

Name:    UNSTABLE_DESTINATION

Message: <Destination> is currently considered an unstable region.

Parameter: Destination

Seqno:    1

3. Define a constraint:

Name: WARNING_UNSTABLE_DESTINATION

SQL Statement:

INVOKE RulesEngine.MessageLanguage

WITH

SELECT     'Constraint Warning', 'UNSTABLE_DESTINATION', 'WARNING', destination

FROM     SCHEDTOUR

WHERE     destination IN ('PAKISTAN','BALI')

Do not specify a constraint message: the component takes care of the message.