Skip to content

Create plugin to evaluate routing assignment thresholds #123

@miquelgall

Description

@miquelgall

Requirements

Given an activity property like this one:

"routingAssignTrack": "Indianapolis IN|US154P Indianapolis IN|2025-12-23|DK185220|US154P78, Keizers Dex|2025-12-23 13:04:41\n|DK185220|US154P78, Keizers Dex|2025-12-23|AR185314|US154P77, Ross Aaron|2025-12-23 14:05:00\n|AR185314|US154P77, Ross Aaron|2025-12-23|DK185220|US154P78, Keizers Dex|2025-12-23 14:10:00\n|AR185314|US154P77, Ross Aaron|2025-12-23|DK185220|US154P78, Keizers Dex|2025-12-23 14:14:33\n|DK185220|US154P78, Keizers Dex|2025-12-23|AR185314|US154P77, Ross Aaron|2025-12-23 15:09:22"

Field Format

Each row is separated by \n and contains the following pipe-delimited fields:

Field Description
user_login Part of logging only assignments made by OFS routing. Does not appear in the log entry directly.
resource_external_id Unique identifier used in the database specific to the resource (bucket/CE) the activity is being moved FROM
resource_name Human-readable name for the OFS GUI
destination_date Futureproofing for when OFS routing can reschedule activities
destination_resource_external_id Unique identifier used in the database specific to the resource (bucket/CE) the activity is being moved TO
destination_resource_name Human-readable name for the OFS GUI
message_time_of_creation Action time of reassignment (UTC)

Plugin Requirements

The plugin should:

  1. Read openParams:

    • reassigments_total_quantity - maximum allowed total reassignments
    • reassigments_recent_quantity - maximum allowed recent reassignments
    • minutes_threshold - time window in minutes for "recent" evaluation
  2. Parse the routingAssignTrack string:

    • Read all rows from the formatted string (split by \n)
  3. Evaluate total reassignments:

    • Check if total number of rows is lower than reassigments_total_quantity
    • Update property: total_reasignments
  4. Evaluate recent reassignments:

    • Count assignments where message_time_of_creation is within current UTC time minus minutes_threshold
    • Check if count is lower than reassigments_recent_quantity
    • Update property: recent_reassignments
  5. Set pin allowed flag:

    • If BOTH criteria pass: set xa_pin_allowed = 1
    • Otherwise: set xa_pin_allowed = 0
  6. Close plugin:

    • Send close message with updated properties
    • Reference 017-populateTeamProperties sample for close message pattern
  7. Descriptor configuration:

    • Include all properties to be updated in the plugin descriptor

Properties to Update

  • total_reasignments - count of total reassignment rows
  • recent_reassignments - count of reassignments within time threshold
  • xa_pin_allowed - 1 if both thresholds pass, 0 otherwise

Reference

  • Use samples/017-populateTeamProperties as reference for sending close message with property updates

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions