Follow-up to #3607367 (account-less notification recipients).

The Assignment plugin type now does double duty: it resolves both a task audience (who a user task is offered to, via candidates()) and a notification audience (who a Notify node or an on-arrival notification reaches, via recipients()). "Assignment" is too task-specific for the second role. #3607367 had to add a NotificationOnlyAssignmentInterface marker plus a pluginOptions() filter so the new Email and Email by variable plugins stay out of the task assignment editor.

Proposed cleanup: introduce a proper type hierarchy and rename the plugin type to Audience.

RecipientInterface                       (resolved value object)
  AccountRecipient
  ContactRecipient

AudienceInterface / AudienceBase         (plugin: recipients(), notifies())
  Email, EmailVariable                   (pure audiences, no task candidates)
  AssignmentInterface extends AudienceInterface   (adds candidates(), viewerTokens())
  AssignmentBase extends AudienceBase
    Users, UsersVariable, Roles, RolesVariable
  • Introduce AudienceInterface as the discovered plugin type carrying recipients() and notifies(); AssignmentInterface becomes a sub-interface adding candidates() and viewerTokens().
  • Rename AssignmentBase to AudienceBase; a new AssignmentBase extends it with the task methods.
  • Rename Attribute\Assignment to Attribute\Audience, AssignmentManager to AudienceManager, the service orchestra.assignment_manager to orchestra.audience_manager, the plugin namespace Plugin\Assignment to Plugin\Audience, and the config schema prefix orchestra.assignment.* to orchestra.audience.*.
  • Convert the Recipient abstract class to RecipientInterface, with AccountRecipient and ContactRecipient implementing it.
  • The task Assignments editor then filters on instanceof AssignmentInterface instead of the marker, so NotificationOnlyAssignmentInterface is deleted.

Cross-repo: the Yoyaku consumer (yoyaku_orchestra ResourceManagers plugin and its config schema) must be updated and its tests run in the same pass.

AssignmentInterface is @api, so this needs a change record and a coordinated update of downstream consumers.

Issue fork orchestra-3607392

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

  • mably committed 2f7b3da8 on 1.x
    feat: #3607392 Rename the "Assignment" plugin type to "Audience" and...
mably’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.