Mapping fields of a core application contact

The method fieldMapping(Entity#Field) by default maps Contact entity and subentity fields in both directions:

To ContactManager
From a core application entity to an XML object to be sent to ContactManager
From ContactManager
From an XML object sent by ContactManager to a a core application

You also use this method to map fields of an entity that the contact references with either an array reference or a foreign key. To map a foreign key or array reference itself, you use different methods, as described later.

Each method call with qualifying methods, if any, is an entry in the set of return values. If you add a method to the set, add a comma after it if your method is not the last method in the set.

Specifying a single mapping direction for a field

You specify a single direction for the field mapping by using the qualifying method withMappingDirection, as follows:

.withMappingDirection(TO_XML)

Maps the field from the core application to ContactManager.

For example, use the following method call to map a PublicID field to the ContactManager External_PublicID field. This mapping is one-way because the core application sets and maintains this value.

fieldMapping(Contact#PublicID)
  .withMappingDirection(TO_XML)
  .withABName(MappingConstants.EXTERNAL_PUBLIC_ID),
.withMappingDirection(TO_BEAN)
Maps the field from ContactManager to the core application.

Mapping fields with differing names

If a field for a contact has a different name in the core application from the name in ContactManager, you map it by using the withABName method. For example, the AddressBookUID property on a ClaimCenter Contact entity is called LinkID on an ABContact in ContactManager. The following code maps these different field names for a Contact entity:

fieldMapping(Contact#AddressBookUID)
  .withABName(MappingConstants.LINK_ID),