Most conversions are handled declaratively in the mapping JSON: valueMaps translate picklist style values, dateFields convert Bullhorn epoch millisecond dates, computedFields join parts into one field. When a conversion needs real logic (parsing, arithmetic, conditional formatting, lookups against the rest of the payload), plug in an Apex transformer.
The package exposes one global interface. In a subscriber org the namespace prefix applies, so you implement bh_3b.BH_Transformer:
global interface BH_Transformer {
Object transform(Object value, Map<String, Object> record,
Map<String, String> params, Boolean isInbound);
}
| Parameter | Contents |
|---|---|
| value | The field value after value map translation and date conversion have already run |
| record | The full source payload: the Bullhorn record (as a map) on inbound, the Salesforce field values on outbound. Lets one field's transform read other fields |
| params | Reserved for future per-mapping parameters; currently empty |
| isInbound | True when converting Bullhorn to Salesforce, false for Salesforce to Bullhorn. One class handles both directions |
Return the converted value. Returning null writes null.
Per field, in both directions, the chain is always:
dateFieldsSo your transformer receives already translated, already converted input.
The class must be global with a no-argument constructor, so the packaged engine can instantiate it by name across the namespace boundary:
global class SalaryBandTransformer implements bh_3b.BH_Transformer {
global Object transform(Object value, Map<String, Object> record,
Map<String, String> params, Boolean isInbound) {
if (value == null) {
return null;
}
if (isInbound) {
Decimal salary = Decimal.valueOf(String.valueOf(value));
return salary >= 100000 ? 'Band A'
: salary >= 50000 ? 'Band B' : 'Band C';
}
// Outbound: bands do not convert back to a number, keep Bullhorn's value.
return value;
}
}
Keep transformers fast and side effect free: no DML, no callouts, no SOQL unless unavoidable. They run inside bulk processing for every record in a batch.
Add a transforms block to the mapping JSON on the BH Entity Mapping record, keyed by the Salesforce field name, with the class name as the value. Use Namespace.ClassName form if your class lives in a namespaced package of its own; a plain class in the org is referenced by name alone:
{
"fieldMap": { "salary": "Salary_Band__c" },
"transforms": { "Salary_Band__c": "SalaryBandTransformer" }
}
The Bullhorn field name is also accepted as the key as a convenience, but keying by the Salesforce field is the documented convention. Save and validate the mapping; a class name that cannot be found or does not implement the interface fails the event at stage config with a clear message.
| Need | Use |
|---|---|
| Fixed value translation (Active becomes Current) | valueMaps |
| Bullhorn epoch date to Salesforce Date or Datetime | dateFields |
| Join several source fields into one | computedFields |
| Anything conditional, computed or parsed | A transformer |
The full mapping schema, including where these keys sit, is in Entity mapping JSON schema.