User Defined Constraints

User-defined constraints are created from the available pool of settings for a given application, endpoint, zone, or logical server. For example, while no predefined constraint allows you to request that HTTP KeepAlive functionality be turned on for the Web site your application is hosted on, you can author a user-defined constraint to specify this. User-defined constraints are simple value constraints in that the value on the item being constrained must be equal to the specified value. Depending on the type of setting being constrained, additional operators like "Contains" and "Between" are also available. You can also define a custom error message for the constraint and specify a Help URL. When the constraint fails, the Error List will display the error message you defined.

Because user-defined constraints offer great flexibility and contain all of the settings used to create predefined constraints, user-defined constraints can conflict with settings used in predefined constraints. The Distributed System Designers do not check whether user-defined constraints conflict with predefined constraints at the time the constraints are authored. Constraints are only checked during deployment diagram validation. The impact of this is that you might create a situation where it is impossible to satisfy all of the constraints at once. If this occurs, you will need to edit or disable some of the constraints to return to a state where constraints are satisfied.

In some cases, you might define a constraint against settings for which the corresponding resource has not been added. Depending on the resource, these constraints are either ignored or an error is fired indicating that the required resource is missing. For more information, see How to: Add Resources.

See Also

Tasks

How to: Author User Defined Constraints

How to: Create Complex Settings