Survivorship Rule Source Objects Bind

The Survivorship Rule Source Objects bind can be used from business actions referenced from a 'business action survivorship rule' to access the source object for a golden record. The Current Object bind is always the target (surviving) golden record. For the 'merge approach', this is the only way to access source records from a survivorship rule business action.

Match and Merge Considerations

The bind can be found within the 'Binds to' dropdown, as shown below.

Configuration

To use any bind:

  1. Create a business rule as defined in the Creating a Business Rule or Library topic here.
  2. Edit the business rule as defined in the Editing a Business Rule topic here.
  3. In the Edit Operation dialog, add the bind to a business rule, as defined in the Adding a Bind topic in the Reference Materials documentation here.
  4. In the Edit Operation dialog, optionally add Messages, as defined in the Adding a Localized Business Rule Message topic here.
  5. In the Edit Operation dialog, add JavaScript to call the bind.

Example

The following is an example JavaScript that uses this bind.

Important: The example scripts should not be used as-is without thorough testing, including updating the script to match object and link types that exist on your system. JavaScript variable names are case-sensitive.

Copy
var attr = golden.getManager().getAttributeHome().getAttributeByID('YOUR_OWN_ATTRIBUTE_ID_HERE');
var goldenValue = golden.getValue(attr.getID()).getSimpleValue();
var hasGoldenValue = (goldenValue != null);println("golden value ".valueOf() + goldenValue + " has gv: " + hasGoldenValue);
for (var it = srcObjs.iterator(); it.hasNext();) {
    var src = it.next();
    var value = src.getValue(attr.getID());
    var srcValue = value.getSimpleValue();
    var hasSrcValue = (srcValue != null);
    println("src value: ".valueOf() + srcValue);
    if (hasSrcValue) {
        if (!hasGoldenValue || java.lang.Integer.parseInt(goldenValue) < java.lang.Integer.parseInt(srcValue)) {
            println("updating golden value to: " + srcValue);
            golden.setSimpleValue(attr, srcValue);
            goldenValue = srcValue;
        }
    }
}