Enrich an entity without losing the input contract
26R1 reference · Documentation-based tutorial draft · Not executed in IFS
What the task does
Section titled “What the task does”An IFS Process Enrichment Task registers workflow variables for inclusion in the process result. It does not create an entity attribute, make a field updatable, or add a client control.
It applies when the underlying operation works with and returns entity data. Do not use it to add entity properties to a call that returns only a primitive value.
Worked pattern: supply a default reference
Section titled “Worked pattern: supply a default reference”Assume a real target has an existing, updatable text property corresponding to the fictional ExternalReference. Verify this in the API/entity metadata first.
- Discover the exact CREATE operation and payload.
- Create a Process Enrichment workflow intended for Before projection timing.
- Add a Script Task that supplies a default only when the value is missing.
- Add an IFS Process Enrichment Task and register the exact attribute variable.
- Save, validate, deploy, and attach the precise projection reaction.
- Create a record with no reference and another with an existing reference.
Original decision fragment:
var currentReference = execution.getVariable('ExternalReference');if (currentReference == null || String(currentReference).trim() === '') { execution.setVariable('ExternalReference', 'DEMO-UNASSIGNED');}This placeholder default illustrates mapping only. A production reference may need uniqueness, provenance, or a different business rule.
Register the right variable
Section titled “Register the right variable”In the enrichment task’s registered-variable list add ExternalReference, after replacing it with your real property name. The deployment-validation reference requires an enrichment task to have at least one registered entry. Do not add an empty task.
Inspect the value leaving the script, the variable registration, and the final stored value. A visible variable in Troubleshoot is not proof that the API persisted it.
Common reasons the value disappears
Section titled “Common reasons the value disappears”| Symptom | Check |
|---|---|
| Variable changes but record does not | Attribute mapping and registration |
| Default fails even on creation | Whether the property is updatable |
| Works for CRUD but not CALL | Whether CALL returns an entity |
| Existing user value is replaced | Missing-value condition |
| Field never appears on screen | Page configuration or client model; enrichment does not place fields |
If the property does not exist, use the configuration or modification workflow first. If another entity must be changed, use an explicit IFS API Task with its own identity and concurrency handling.
Acceptance evidence: blank input receives the permitted default, a supplied value is preserved, the intended property persists, and the workflow does not create a trigger cycle.