You can use the lifecycle UML modelling tooling in WSRR
Studio to configure property assertions. A property assertion is a
rule that is applied to the properties on an object when a lifecycle
transition is attempted. If the rules of the assertion are not satisfied,
then the transition cannot be made.
Procedure
Note: The Property Assertions dialog that is described
in this topic offers basic customization choices. if you want to customize
your assertion beyond the basic choices offered in the Property Assertions
dialog, click
Advanced to access the full-featured
WSRR Governance Policy editor; for details, see
Editing policy rules.
With the WSRR
Property Assertions dialog open, configure the assertion
by completing the following steps:
- Enter the name of the assertion in the Assertion
Name field.
- In the Property field, specify the
property to which you want this assertion to apply. You can either
select a property from a list, or specify your own property. The list
contains all String properties on all objects that
are currently set to traverse this lifecycle; see Assigning a business model class to a lifecycle. You can add
your own type value if necessary; for example, to test the assertion
against a user-defined property.
Note: A user defined property
must be of type String.
- In the Type field, select the type
of object to which you want this assertion to apply. Alternatively,
the type can be the name of a Java™ class;
in this case, the property assertion calls the constructor of the Java class, passing the property
value as a parameter. The Java class
must have a constructor that takes an argument of type String.
- Set an assertion type in the Assertion field.
This is the rule that objects of the selected type must satisfy to
pass this assertion. This field has the following options:
| Option |
Description |
| Has no value |
The property must not have a value set.
This element is mutually exclusive to NotNullConstraint. |
| Has value |
The property must have a value set. This
element is mutually exclusive to NullConstraint. |
| Is within range |
The value of the property must be numeric and
must lie inclusively between the values specified for the minValue and maxValue attributes
of this element. |
| Has specific value |
The value of the property can be any of the
following: - exactly equal to the string specified for the Value field.
- equal to the regular expression specified for the Value attribute
of this element; see java.util.regex.Pattern in the
Javadoc API reference for details, because the String.matches method
is used to make the comparison.
- exactly equal to the value of the property identified using the
entityID, which was set on an EntityAssertion, and a propertyName.
You must use the following format for the value attribute of this
element: ${entityID}/propertyName.
|
| None <Existence check only> |
This indicates that the assertion only has a
relationship name. |
- Enter an appropriate value or values in the Value field.
What you enter here depends on the type of assertion.
- Set the required value in the Read Only field. This field determines whether the property can be changed during
an update operation. The value of this attribute must be one of the
following:
- true: the property cannot be changed.
- false: the property can be changed.
The default value is false.
- Ensure that the correct value is selected in the Policy
File field. If you do not want to use the automatically
selected policy file, or any of the existing files specified in the
list, you can specify the name for a new policy file.
- Enter a message in the Failure Message box.
This is the message that is displayed to the user if the assertion
fails and the transition is not allowed to complete.
- Click OK. The policy assertion is
added to your transition.