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
AudienceInterfaceas the discovered plugin type carrying recipients() and notifies();AssignmentInterfacebecomes a sub-interface adding candidates() and viewerTokens(). - Rename
AssignmentBasetoAudienceBase; a newAssignmentBaseextends it with the task methods. - Rename
Attribute\AssignmenttoAttribute\Audience,AssignmentManagertoAudienceManager, the serviceorchestra.assignment_managertoorchestra.audience_manager, the plugin namespacePlugin\AssignmenttoPlugin\Audience, and the config schema prefixorchestra.assignment.*toorchestra.audience.*. - Convert the
Recipientabstract class toRecipientInterface, with AccountRecipient and ContactRecipient implementing it. - The task Assignments editor then filters on
instanceof AssignmentInterfaceinstead of the marker, soNotificationOnlyAssignmentInterfaceis 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
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
Comment #4
mably commented