See also: Writing Registry Plugins and Configuring Registry Identifier Assignment


Identifier Assignment Plugins are Experimental, and the interface is subject to change in a future release.

Plugin Requirements

  1. The name of the Plugin should match the format FooAssigner.
  2. The Plugin should implement a FooAssigner model.
  3. The Plugin must implement an assignment routine in the FooAssigner model, as described below.

Instantiation

Identifier Assignment Plugins are not currently instantiated, and will be available globally once installed.

Assignment

The Plugin must implement an assignment routine in the FooAssigner model, with the following signature:

public function assign($coId, $context, $recordId, $identifierType, $emailType=null)

where

  • coId: The CO to assign the identifier within.
  • context: The context for assignment, an IdentifierAssignmentContextEnum.
  • recordId: The record ID (of the type indicated by the context) to assign an identifier for.
  • identifierType: The identifier type to assign.
  • emailType: If not null, the email type to assign.

(info) Plugins will be called within a database transaction.

Return Values

assign() should return the new identifier as a string, or throw an Exception on error.

(info) The plugin will be called once to generate a unique identifier. If the identifier returned is already known to Registry, or any other error occurs, the assignment process will fail.

  • No labels