The Connection Request Manager manges requests for connections sent from the Request connection step type. It is located using binding "connectionRequestManager" and is typically found in the advanced settings of the process client.
A connection request is made from a worker to the connection manager, passing the email address of the intended recipient, and actions for accept and decline callbacks. This looks up for an existing Connection Request for the same email address. If one is found:
- If the connection request has previously been accepted, the accept callback is invoked passing it the connection details.
- If the connection request has previously been declined, the decline callback is invoked.
- If the connection request is still pending, the details of the worker are stored in a list of pending workers for the connection request.
If the connection request is not found, a new one is created. The worker is stored in a list of workers associated with the pending request, a timeout set for cancelling the request, and an email sent to the partner. The email includes link to the same instance of the service, using the account action functionality which prompts the user to sign in or sign up and then take the account action. The account action is set to the Connection request account action, and installOptions are set to identify the connection request and provide a secret token to secure the access (inasmuch as anything sent by email can be secure).
Assuming the partner clicks on the link, the account action will run and call back to the connection request with details which can be used to identify an existing connection or which can be used to complete a new connection with the partner. The connection request then calls the accept callback in each of the workers in its pending list, passing them the existing or new connection.
If the partner does not respond to the link within the timeout period, the connection request is considered declined and the decline callbacks for all the workers in the pending list are called.
The account action is looked up from the Configuration node identified by the binding "configuration". This contains a Connection request account action reference, which is a binding reference which is resolved from the account node to find the appropriate account action. This allows different applications and different account authorities to have different configurations for the auto-created accounts.
Need to consider if we can have a "not at this time" decline option from the email.