Following article present how to set primary account for applications with multiple account per identity (person).
the setup involve two actions:
1. update UI Config, adding priamry account tag which will be shown under 'Applications' of each identity, an icon(star) will be added presesnting which account is the primary.
<entry key="accountIconConfig">
<value>
<List>
<AccountIconConfig attribute="primaryAccount" value="true" source="/images/icons/icon_Star.png" title="Primary Account"/>
</List>
</value>
</entry>
2. adding to 'Global Settings'->'Account Mapping' an attribute name "primaryAccount" with source of calulating primary, can be an application attribute or rule.
the result: