Page 340 -
P. 340
336 M. Pesic et al.
12.7 Optional Constraints
So far in this chapter, we have used models where all constraints are mandatory.
However, as discussed in Chap. 6, constraints can also be optional, that is, they can
be violated. If the user is about to violate an optional constraint, DECLARE issues a
warning. This warning contains additional information about the constraint, and it
should help the user when deciding whether to proceed and violate the constraint,
or to abort and not violate it. As Fig. 12.9 shows, additional information for optional
constraints contains (1) a group; (2) the importance level on a scale from 1 (for low
importance) to 10 (for high importance), and (3) some local message that should be
displayed. This additional information for an optional constraint is presented in the
warning given when a user is about to violate this constraint.
Groups for optional constraints are defined in the Designer component and can
be used to define corporate policies, etc. Each group has a name and a short descrip-
tion, as illustrated in Fig. 12.10, and end-users should be able to interpret them.
For example, it should be easier to decide to violate a constraint belonging to the
Ordering Policy, than a constraint that belongs to the Billing Policy.
In some cases, triggering an event or closing the instance can violate optional
constraint(s). For example, consider an instance of the DECLARE model shown in
Fig. 12.11, where the user attempts to start executing task bill. Note that, despite the
precedence constraint, it is possible to start task bill in this instance. This is because
this constraint is optional. If the user would now attempt to start executing task bill,
DECLARE would first issue a warning associated with the optional constraint, as
shown in Fig. 12.11. The user can now decide based on the information presented in
the warning whether to start the execution of task bill and violate the constraint or
not. Note that, in case of mandatory constraints, this is not possible, that is, if this
would be a mandatory constraint, it would not be possible to start executing task bill
at this moment.
Fig. 12.9 Defining the optional constraint precedence

