Computing initial values for properties
To compute the initial value of a business-specific rule property, you implement an interface to compute property initial values and associate it with a rule model property through a key.
About this task
For example, if you have two properties, creationDate and expirationDate, attached to an artifact, you can compute and set the creationDate property to the current date, and set the expirationDate property to five years after the current date.
Procedure
To compute the initial value of a property:
Results
In XML, you associate the property to the key that references the implementation as follows:
<?xml version="1.0" encoding="UTF-8"?>
<model:extension-model xmlns:model="http://ilog.rules.brms.extension/model"
name="myExtension" nsURI="http://ilog.rules.brms.extension/myExtension">
<add-property className="BusinessRule">
<property extractable="true" name="creationDate" type="Date">
<annotation id="initialValueCallback" value="datesHandlerID"/>
</property>
<property extractable="true" name="expirationDate" type="Date">
<annotation id="initialValueCallback" value="datesHandlerID"/>
</property>
</add-property>
</model:extension-model>
You have implemented the calculation of an initial value for a property. You can now integrate it into Rule Designer or Decision Center.
Integration into Rule Designer |
Integration into Decision Center |
|---|---|
| Create a Rule Designer plug-in with an initial value callback extension point. Integrating initial values for properties into Rule Designer |
Repackage the Decision Center archive to integrate and declare the classes for computing property initial values. |