Working with Constraints
Constraint definitions let you veto the submission of a Process Definition or Chain Definition if it contains Parameters values that violate certain rules. Constraints are based on Constraint classes, which must be defined in a library.
To create a Constraint definition, navigate to Definitions > Constraints and click .
Tabs and Fields
The following table illustrates the fields of each tab of Constraint Definition editor dialogs.
Field | Description |
---|---|
Library | The library containing the Constraint class. |
Factory Class Name | The FQCN of the Constraint class. For example: com.redwood.scheduler.custom.constraint.MyConstraint . |
Attaching a Constraint Definition to a Process or Chain Definition
There is no way to attach a Constraint definition to a Process Definition or Chain Definition in the user interface. Instead, use a RedwoodScript Process Definition with a Source script like the following.
{
ConstraintDefinition cd = jcsSession.getConstraintDefinitionByName("MyConstraintDefinition");
JobDefinition jd = jcsSession.getJobDefinitionByName("MyProcessDefinition");
jd.createJobDefinitionConstraint(cd);
jcsSession.persist();
}