Configuring account relationships
Account relationship object model
The following illustration shows account entities associated with account relationships. See the Data Dictionary for a complete list of all properties in the entities. The illustration displays a partial list.
The AccountAccount entity represents
a relationship between a SourceAccount
and a TargetAccount. The
SourceAccount and TargetAccount can be the same.
The RelationshipType field
is a typekey to the AccountRelationshipType
typelist. For more information, see Account relationship typelist.
For account relationships, the Account entity has two arrays:
SourceRelatedAccounts
and TargetRelatedAccounts.
Each array contains AccountAccount
entities, which link back to Account
with the SourceAccount
and TargetAccount fields.
The getAllRelatedAccounts
method returns a derived array which returns an AccountAccount entity for all
source and target related accounts. For most account relationships, this
field returns two AccountAccount
entities. If an account is related to itself then the return array includes
only one AccountAccount
entity, even though that AccountAccount
appears in both SourceRelatedAccounts
and TargetRelatedAccounts.
A single AccountAccount entity represents a bidirectional relationship from
its SourceAccount to its TargetAccount. For example,
if account A is the parent of account B, then the single AccountAccount
also represents that B is the child of A.
The SourceRelatedAccounts
array is marked as owner
which forces account validation to run when an AccountAccount in this array is
added or updated. The default validation ensures that no duplicate relationships
are created. The TargetRelatedAccounts
array does not need to be owner
because the target accounts are included implicitly in the validation
rules. For more information about the owner
attribute, see <array>.
In Studio, the owner attribute is set in Account.eti located in .
The SourceAccount,
TargetAccount, RelationshipType and Retired fields of each AccountAccount entity must be
unique. Therefore, no SourceAccount
may be related to the same TargetAccount
with the same RelationshipType
more than once.
Account relationship typelist
The AccountRelationshipType
typelist is extensible, and represents the relationship from the perspective
of the source account. The following table lists the codes for the AccountRelationshipType typelist
in the base configuration.
Typecode |
Name |
|---|---|
|
|
|
|
|
|
In the base configuration, the parent and child relationships are the inverse
of each other, while commonowner
is reciprocal. For example, if account A is the parent of account B,
then B is the child of A. Similarly, if A is a common owner with B, then
B is also a common owner with A.
Account relationship methods in the Account plugin
The getInverseRelationshipType
method of the IAccountPlugin
takes as input a relationship type, and returns the inverse relationship
type. PolicyCenter assumes that all relationships have an inverse relationship,
therefore this method must not return null. You can modify the default
behavior of getInverseRelationshipType
method and add code to handle new typecodes.
Account relationship rule sets
In Studio, rule sets are grouped by function for the purpose of customizing a process. This topic describes the rules that pertain to account relationships.
The following table describes rule sets in the default application related to account relationships.
Rule |
Description |
|---|---|
|
Invoked when an AccountAccount entity is added or updated. Performs the following checks:
If necessary, you can modify or add additional validations. |
Account relationship methods in Gosu classes
This topic describes various methods in Gosu classes for working with account relationships.
Adding a relationship
Use the Account.addRelationship
method in AccountBaseEnhancement
to add relationships to an account. This method creates and returns a
new AccountAccount entity.
The new AccountAccount
appears in Account.SourceRelatedAccounts
and in relatedAccount.TargetRelatedAccounts.
Removing a relationship
You can remove a relationships by simply removing the AccountAccount entity in one of the following ways:
- Calling the
removeFromSourceRelatedAccountsor removeFromTargetRelatedAccounts method on an Account entity - Calling
removeon the AccountAccount entity
Getting relationships
The getRelationship
method in the AccountAccountEnhancement
wraps an AccountAccount
in a new AccountRelationship
Gosu object that is aware of the direction of the relationship.
AccountAccount.getRelationship(primaryAccount : Account) : AccountRelationshipThis method returns
an AccountRelationship
which represents an AccountAccount
from the perspective of the argument primaryAccount.
The AccountRelationship
provides two properties, which are both readable and writable:
OtherAccountrefers to the other account in the relationship from the perspective ofprimaryAccount. So ifprimaryAccountis theSourceAccountof a relationship thenOtherAccountmaps to theTargetAccount. Conversely, ifprimaryAccountis theTargetAccountin the relationship, thenOtherAccountmaps to theSourceAccount.RelationshipTypeis the type of relationship from the perspective ofprimaryAccount. IfprimaryAccountis theSourceAccountof anAccountAccountrelationship, thenRelationshipTypeis the same as the type in theAccountAccount. IfprimaryAccountis theTargetAccount, thenRelationshipTypeis the inverse of the type in theAccountAccount.
Example
Assume there is an AccountAccount whose SourceAccount is A, TargetAccount is B, and RelationshipType is parent. The AccountAccount object has the
following relationships:
AccountAccount.getRelationship(A).OtherAccount == BAccountAccount.getRelationship(A).RelationshipType == "parent"AccountAccount.getRelationship(B).OtherAccount == AAccountAccount.getRelationship(B).RelationshipType == "child"
Getting all relationships
The Account.getAllRelationships
method in AccountBaseEnhancement
returns an array of AccountRelationships
for all relationships of an account.
Account.getAllRelationships : AccountRelationship[]Configuring shared contact search criteria
On the Related Accounts screen, you can search for Accounts with a common account holder or named insured. In the base configuration, the search finds accounts with contacts that are account holders or named insureds on both accounts.
You can view and modify the code for the
search in gw.account.SharedContactAccountSearchCriteria.
The SearchableSharedContactRoles
property defines the contact roles that this search includes.
