Assignment matrix
The assignment matrix is the engine that connects an employee's profile attributes to the assignment rules that apply to them. When an attribute changes, Better Comply re-evaluates all active auto-assign rules and creates any missing assignments.
Administrators (Quality Admin, HR Admin, Corporate Admin). Operators who manage bulk imports and scheduled jobs should also read the "Recompute queue" section.
Profile attributes
Each employee profile can carry the following assignment-relevant attributes:
| Attribute | Type | Set where |
|---|---|---|
| Department | Select | User profile editor |
| Location | Select | User profile editor |
| Activity | Free text | User profile editor |
| Plant | Free text | User profile editor |
| Line | Free text | User profile editor |
| Workstation | Free text | User profile editor |
| Custom attributes | Key/value pairs | User profile editor |
Administrators set these values when creating or editing a user through Users & access. Managers with edit access to their direct reports can update the attributes from the same interface.
How matching works
When a recompute runs for a user, Better Comply evaluates every active rule that has auto_assign enabled. For each rule it checks whether the user's profile satisfies all the rule's target dimensions.
The matching logic follows two rules:
- AND across dimensions. All populated dimensions on the rule must match.
- OR within a dimension. Within a single dimension, matching any one listed value is enough.
- Empty dimension = wildcard. A dimension left empty on the rule matches any value (including no value).
A rule whose every populated dimension matches the profile is a hit. Better Comply then finds or creates the appropriate campaign and assignment for that (training, version, user) combination.
Recompute is additive and idempotent
This is an important property: recomputing never deletes assignments and never creates duplicates.
- Additive - if a user already has an assignment for a training, re-running the recompute leaves that assignment untouched. It only creates assignments that do not exist yet.
- Idempotent - running the recompute once or ten times for the same user produces the same result. The underlying mechanism is a deterministic campaign naming scheme (
Onboarding: <rule name>) combined with a database constraint (UNIQUE(user_id, campaign_id)) that silently absorbs duplicate inserts.
This means you can safely re-run apply-onboarding-rules after fixing a rule or correcting an employee's attributes. Past evidence records are always preserved; the recompute only adds.
Evidence records in Better Comply are immutable. Removing an employee from a rule's target audience, or disabling a rule, does not delete their prior assignments or evidence. This is required for audit-readiness under ISO 9001 and 21 CFR Part 11.
See the Compliance section for more on evidence immutability.
What triggers a recompute
Immediate recompute (single user)
When you save a user's profile and one or more assignment attributes have changed (department, location, activity, plant, line, workstation, or custom attributes), Better Comply immediately re-evaluates all active auto-assign rules for that user and creates any missing assignments. You can see the result on the user's assignments list within a few seconds of saving.
Recompute queue (bulk updates)
For bulk operations - such as importing employees from a CSV file or updating many profiles at once - Better Comply queues each affected user in an internal recompute queue. A scheduled drain job processes this queue in batches of up to 200 users, de-duplicating multiple changes for the same user into a single recompute pass. The drain runs automatically on a schedule; its timing depends on how your operator has configured the Cloud Scheduler cron.
The drain endpoint is POST /v1/drain-assignment-recompute, gated by the internal secret. It processes up to 200 queued rows per run, de-duplicates by user, and stamps processed rows with a timestamp. The queue is not currently pruned automatically - the processed rows accumulate until a future maintenance release adds a prune function. This is low risk for most deployments.
See the Operations documentation for scheduling details.
On rule creation or edit
When you create or edit an assignment rule, Better Comply does not automatically re-run a global recompute. The next attribute change for each affected user, or the next scheduled drain, will pick up the new or changed rule. If you need an immediate full recompute after a rule change, use the Simulate button on the Assignment rules page as a check, then contact your operator to trigger an out-of-schedule drain if needed.
Campaign naming convention
Auto-generated campaigns follow a deterministic naming pattern:
Onboarding: <rule name>- created when an assignment rule assigns a training to a userRecertification: <training name> v<version label>- created when "re-certify everyone" is triggered on a version approval
This naming is stable across reruns, which is how idempotency works: the system finds the existing campaign by name and training version before deciding whether to create a new one.
Related
- Assignment rules - create and configure the rules that feed the matrix
- Users & access - set the profile attributes that rules match against
- Recertification - how version-triggered re-enrolment works
- Scheduling and overdue rules - how due dates are calculated from the assignment date