Table of Contents
Last updated: 2024-11-14

Rule based consolidation: Force only one entry


In some business situation, where in the ShareAspace model an object has an array association with another object, there is a need to constraint that association to a single one.

For instance, let's consider an Organization. In the ShareAspace model the Organization object can have an unlimited number of associations with the object Person. Let's assume that at the business level what we want is to have a single association "CEO" to Person.

The default behavior of the consolidation engine is not limiting the number of "CEO" for an organization, we then have to set a rule that say this association is a singleton over the time.

The setting ForceOnlyOneEntry is used in the consolidation engine for expressing such a rule.

Note

The setting ForceOnlyOneEntry only works against relationships that are arrays.

For relationships that are effectivity controlled, a consolidation with the setting ForceOnlyOneEntry will always result leaving only one relationship active in the time (the imported one) and closing the other ones.

For relationships that are not effectivity controlled, a consolidation with the setting ForceOnlyOneEntry will always result in replacing the one in the store by the one being imported.

The setting ForceOnlyOneEntry is in a way similar to the SoftType rule [0..1] or [1..1] for the properties that are arrays at the ShareAspace model.

The setting ForceOnlyOneEntry is depending on 4 parameters

  • the name of the object
  • the name of the relationship on the object
  • the role of the relationship (optional if not provided will act on all relationships of the given object instances regardless the role value)
  • the SoftType id (optional, if not provided will act on all instances of the given object regardless the SoftType)
Warning

The SoftType Id parameter in the setting is not yet supported.

Usual "Force Only One Entry" situation

The following example use a ForceOnlyOneEntry setting with

  • Organization as the object
  • PersonOrganizationReferenceSelect_personOrganizationReferences as the relationship
  • "CEO" as the role value
Consolidation_Setting {
    "Organization-PersonOrganizationReferenceSelect_personOrganizationReferences-CEO"
}

force-one-entry-case1

The PersonOrganizationReference is an effectivity controlled relationship. The imported data has the same role has in the store, the referenced Person is not the same and the start date is after the active one in the store.

The consolidation engine is closing the one in the store at the start date of the imported one, and add the one imported as being the only one active.

Note

Without the setting this would have resulted as 2 relationships active, the one in the store would have been left untouched.

"Any" role

The following example use a ForceOnlyOneEntry setting with

  • Organization as the object
  • PersonOrganizationReferenceSelect_personOrganizationReferences as the relationship
Consolidation_Setting {
    "Organization-PersonOrganizationReferenceSelect_personOrganizationReferences"
}

This indicates that the consolidation will act on any PersonOrganizationRelationship (on the imported object) regardless the role value in the store. In other words all PersonOrganizationRelationship, on the imported object will be turned off leaving only the one imported active.

force-one-entry-case2

Same child situation

The following example use a ForceOnlyOneEntry setting with

  • Organization as the object
  • PersonOrganizationReferenceSelect_personOrganizationReferences as the relationship
  • "CEO" as the role value

The imported data referenced Person is the same as the one referenced in the store and the role is the same in the store.

Consolidation_Setting {
    "Organization-PersonOrganizationReferenceSelect_personOrganizationReferences-CEO"
}

In this case the imported data is simply ignored and no change in the store is performed.

force-one-entry-case3

Failing consolidation cases

The only situation when this setting is failing an import, is when the start date of the imported data that match the stored one is before the one in the store.

force-one-entry-failcase