Custom Fields API
Reduce database calls when setting multiple task or case custom fields by providing a new API that allows to set multiple fields at once.
Calling ICustomField#set consecutively generates 8+ database queries per call. The new API reduces that to 1 per custom field value to be set plus some additional ones per call.
Additionally, some optimization has been implemented in the back end to reduce database queries in general. For example, by checking whether the value to be set actually differs from the current value and omitting the update entirely if it does not.
Audience
Value
- Better performance when setting multiple task or case custom fields in a UI action
Version
Discussion
- Could be further improved by supporting SQL batch modes. Worth it?
- If multiple things are set on a task or case, we could further improve performance by providing a transaction API. Worth it?
Next steps
Screenshots / Code
ivy.task.customFields().set(
List.of(
CustomFieldValue.string("branchOffice", "Zug"),
CustomFieldValue.number("numberOfEmployees", 120),
CustomFieldValue.timestamp("lastAudit", new Date())));