The topic "Adobe Sign Workflow Sample - Multiple Signers" is not available in Version 3.5.
The topic "Adobe Sign Workflow Sample - Multiple Signers" is not available in Version 3.6.
Adobe Sign Workflow Sample - Multiple Signers
The following procedure details a sample workflow and forms for a sequence that contains multiple signers.
Prerequisites
-
The Adobe Sign properties are configured in Forms Builder. See Adobe Sign Settings.
-
An authenticated form sequence is created. In our example, the sequence includes the following forms:
-
Welcome
-
CMC_Student_Personal_Adobe_Multi — This is an admissions application form that collects the personal data of a student and contains 6 Adobe Sign components:
-
Signer 1: Signature, Date Signed, Date, and Initial (4 components)
-
Signer 2: Signature, Date Signed (2 components)
The signing process for the primary signer is the same as described in Adobe Sign Workflow Sample - Single Signer. The signing process for the primary signer is an embedded process within the form window. For the secondary signer, Adobe Sign sends an email along with the document to be signed to the secondary signer. The signing process for primary and secondary signer takes place within the same Adobe Sign request. Adobe Sign returns events when each signer signs the document and when the document is complete. The workflow responds to these events.
-
-
Default-Frame — This form contains an IFrame component.
We recommend that you copy the original Default-Frame form, edit the copy, and use it in your sequences. Save a backup copy of your form. In your copy of the form, edit the Name property as shown below (case sensitive). Keep the URL property as {{vm.models.frameUrl}}.
Name = AdobeSignFrame
-
Default-DocuSignWait — This form is provided with the Forms Builder installation. We suggest that you copy and rename it to AdobeSignWait. It contains two HTML components.
The first HTML component displays the following text. Edit the text in your copy of the form.
"Current user may close this browser tab. This page will auto submit when all the signatures are collected from DocuSign."
The second HTML component contains JavaScript code that is not applicable to Adobe Sign. Remove that HTML component in your AdobeSignWait form.
The Default-DocuSignWait form will be overwritten when Forms Builder is upgraded. Copy the original form, rename it to AdobeSignWait, edit the copy, and use it in your sequences. Save a backup copy of your form. This logic can be repeated as needed for additional signers.
-
Default-Confirmation — This form is provided with the Forms Builder installation. It has an HTML component that displays the text:
"This page will be displayed at end of each sequence as confirmation. Please update with custom confirmation message."
-
To optimize the display of your e-signature forms on mobile devices, you may want to add the CSS described in this Note.
Test the Multiple Signer Feature
To test the multiple signature feature with Adobe Sign, the test environment needs to meet specific requirements. Adobe Sign will try to call APIs on Renderer when secondary signers complete their signing process via email. This feature is referred to as Webhook.
-
If you are testing with an Adobe Sign account in test mode:
-
Renderer must be hosted on port 80 or 443.
-
Port 80 or 443 must be open on the firewall depending on which port Renderer is using for Adobe Sign to communicate. You can request an exception from your IT team for port 80 or 443 for an IP address range.
-
-
If you are testing with a live Adobe Sign account:
-
Renderer must be hosted on port 443 (https).
-
If hosting Renderer on port 443 is not possible, an Adobe Sign representative for your account will have to make an exception.
To confirm that multi-signature forms are completing the workflow process, please confirm that Webhook responses are received and displayed in the log. For more information, see Webhook Responses for Multiple Signer Sequences.
Chrome Browser Settings for Multiple Signers
The multiple signer feature for Adobe Sign requires a specific setting in Google Chrome. If you experience issues with multiple signer forms, ensure that third-party cookies are allowed.
-
In Chrome, select Settings.
-
Click Advanced.at the bottom of the page.
-
Expand Site Settings.
-
Expand Cookies and site data.
-
Disable Block third-party cookies.
Create the Workflow
-
Launch Workflow Composer and open the workflow. See Open the Workflow for a Sequence.
-
In Workflow Composer, drag the state icons and transition lines to so that you can easily locate each item in the StateMachine workflow.
The workflow requires the following arguments and variables. You can create these arguments and variables before working on the activities, or you can add them when they are needed for a specific activity (described below).
Keep in mind that arguments are passed in JSON format and that JSON elements are case sensitive. Be sure to match the casing of argument names in Workflow Composer and Form Designer. |
Arguments
Variables
LogLine Activities
While testing and troubleshooting the workflow, we recommend adding LogLine activities at critical stages within the workflow. The following expression will provide logging for specific objects (replace <object> with the object name):
Newtonsoft.Json.JsonConvert.SerializeObject(<object>, Newtonsoft.Json.Formatting.Indented)
We recommend setting the Level value to Information for any LogLine or LogObject activities. See Best Practices for Logging and Logging in Azure.
Note: If your sequence is non-authenticated (Anonymous=true), the LookupUser and GetEntity activities are not applicable, but a CreateEntity activity may be needed instead. Be sure that any anonymous sequence includes the user's email address. It is required as the Adobe Sign recipient address.
Use the Welcome form to retrieve the Student Id and Student Entity.
-
Double-click the icon of the Welcome state.
-
Create a variable named studentid of Type Int32.
-
Drop a LookupUser activity into the Entry area of the Welcome state.
- In the UserId property, specify the studentid variable.
- In the UserName property, specify formInstance.UserName.
-
Drop a GetEntity activity below the LookupUser activity.
- In the EntityId property, specify the studentid variable.
- In the Result property, specify studentEntity.
-
Save the workflow locally and continue with the next set of steps.
Since the workflow can be busy for a long time, we recommend that you persist the workflow instance before creating the PDF.
-
Double-click the Next transition between the CMC_Student_Personal_Adobe_Multi and Default-Frame states.
-
Drag a Persist activity into the Trigger area below the Next activity. The Persist activity does not require any properties to be specified.
Workflow Composer automatically wraps the Next and Persist activities in a Sequence.
-
Save the workflow locally and continue with the next set of steps.
-
Create a variable named URL. Set the Variable type to String. Set the Scope to StateMachine. This variable will be assigned to the PDF created from the form.
-
Drop an Assign activity into the Entry area of the Default-Frame state.
-
In the To field, specify the variable name URL.
-
In the Value field, specify the following:
formInstance.RendererBaseUrl + "#/viewCreator/" + formInstance.WorkflowDefinitionId.ToString + "/forms=CMC_Student_Personal_Adobe_Multi"
Where "/forms=CMC_Student_Personal_Adobe_Multi" indicates the Forms Builder form that contains the Adobe Sign components.
Notes
-
If the form name has a space, replace the space with a + sign.
-
If multiple forms are sent to Adobe Sign, specify a comma-separated list of form names in the "/forms=" attribute.
-
-
-
Drop a Persist activity below the Assign activity.
-
Create a variable with a name like Pdf. Set the Scope to StateMachine. This variable will hold the document image created from the form.
Note: Make sure you use the same variable name when you reference this variable later in the workflow. (This applies to any other variable.)
-
In the Variable type field, select Array of [T] and select Browse for Type.
-
In the "Browse and Select a .Net Type" window, specify byte, select the System variable Byte, and click OK.
-
-
Drop a PrintUrlToPdf activity below the Persist activity.
Specify the properties for the activity as follows:
-
PdfDocument = Pdf (This is the name of the variable created above.)
-
Url = URL (This is the name of the variable created above.)
-
Validation Messages = formInstance.ValidationMessages
-
-
Save the workflow locally and continue with the next set of steps.
In the following steps we will continue to add activities to the Default-Frame state.
-
Create a variable named AdobeSignConfig. Set the Scope to StateMachine.
In the Variable type field, select Browse for Type. In the "Browse and Select a .Net Type" window, scroll down to Cmc.Nexus.FormsBuilder.Contracts > Cmc.Nexus.FormsBuilder.Entities and select AdobeSignConfig.
-
Drop a GetAdobeSignConfig activity below the PrintUrlToPdf activity.
Specify the properties for the activity as follows:
- AdobeSignConfig = AdobeSignConfig
- Validation Messages = formInstance.ValidationMessages
The GetAdobeSignConfig activity retrieves your user credentials from the Adobe Sign settings in Forms Builder. These values enable the workflow to log in to Adobe Sign.
-
Create the following variables:
Variable Name Type Scope Default AdobeSignRecipient Cmc.Nexus.FormsBuilder.Entities.
AdobeSignRecipientStateMachine New AdobeSignRecipient AdobeSignRecipient2 Cmc.Nexus.FormsBuilder.Entities.
AdobeSignRecipientStateMachine New AdobeSignRecipient AdobeSignDocument Cmc.Nexus.FormsBuilder.Entities.
AdobeSignDocumentStateMachine New AdobeSignDocument AdobeSignRequest Cmc.Nexus.FormsBuilder.Entities.
AdobeSignRequestStateMachine N/A -
Below the GetAdobeSignConfig activity, drop an Assign activity for each row in the following table and type the indicated values:
"To" Field Value Notes AdobeSignConfig.EmailSubject "Adobe Sign Test at " + DateTime.Now.ToString() This is the email that the end user will receive after the signing process is done. AdobeSignDocument.DocumentId "1" The SignerId should match the Signer property in the Adobe Sign component on the form. Allowed values are "1" to "5". AdobeSignDocument.Name "StudentInfoPdf.pdf" Name of the signed document. AdobeSignDocument.Content Pdf Name of the variable that holds the document image (see Create a PDF of the Form). In our example the name of the variable is Pdf. AdobeSignRecipient.FirstName studentEntity.FirstName First name of the user who submitted the signed document. AdobeSignRecipient.LastName
studentEntity.LastName
Last name of the user who submitted the signed document. AdobeSignRecipient.Email studentEntity.EmailAddress Email address of the person who will receive the signed Adobe Sign document. AdobeSignRecipient2.FirstName First name of the co-signer who submitted the signed document. This could be a parent name from the StudentRelationshipAddressEntity. AdobeSignRecipient2.LastName Last name of the co-signer who submitted the signed document. This could be a parent name from the StudentRelationshipAddressEntity. AdobeSignRecipient2.Email Email address of the co-signer who will receive the signed Adobe Sign document. This could be the email address retrieved from the StudentRelationshipAddressEntity. AdobeSignRecipient2.SignerId "2" The SignerId should match the Signer property in the Adobe Sign component on the form. Allowed values are "1" to "5". -
Save the workflow locally and continue with the next set of steps.
In the following steps we will continue to add activities to the Default-Frame state.
-
Drop the CreateAdobeSignRequest activity below the previous activity.
Specify the properties using the names of the variables created above as follows:
Notes
-
The expression for AdobeSignRecipients passes multiple items (the primary and secondary recipient) within an array.
-
The out argument AdobeSignRequest returns the URL of the signed document.
-
-
Drop an If activity below the CreateAdobeSignRequest activity and specify the following condition:
formInstance.ValidationMessages.HasErrors
-
Add a LogLine activity to the Then branch and specify a message to capture errors, e.g.:
Environment.NewLine & "ERROR in CreateAdobeSignRequest: " & Environment.NewLine & formInstance.ValidationMessages.Item(0).Message
-
Add an Assign activity to the Else branch.
-
In the To field, specify frameUrl. (This is the argument associated with the IFrame form.)
Be sure to use the exact casing shown here.
-
In the Value field, specify AdobeSignRequest.Url.
-
-
Save the workflow locally and continue with the next set of steps.
The IFrame form (Default-Frame) will receive the Adobe Sign document with the first signature, but the signing process is not yet complete. We want the workflow to continue with the AdobeSignWait form upon receipt of the first signature. The workflow will pause on the AdobeSignWait form until the second signature is received. If user closes the form or logs out after submitting the first signature, upon return to the form, the workflow will display the AdobeSignWait form.
-
Double-click the Done transition leading to the End state.
-
In the Trigger area, name the WaitForFormBookmark as Collecting Other Signatures.
-
Select Transition Type = MoveForward on the WaitForFormBookmark activity.
-
Drop a GetAdobeSignRecipientStatus activity below the WaitForFormBookmark activity.
Specify the properties using the names of the variables created above as follows:
-
Specify the following in the Condition field for the Done state:
AdobeSignRecipients(1).Status.Equals("COMPLETED")
This ensures that even if the user clicks the button ”Collecting Other Signatures" instead of closing the browser, the workflow will not proceed until the status of the additional signer is COMPLETED.
-
Drop a GetAdobeSignRecipientStatus activity into the sequence.
Specify the properties using the names of the variables created above as follows:
-
Create a variable named AdobeSignSignedDocument. In the Variable type field, select AdobeSignDocument. Set the Scope to StateMachine.
-
Drop a GetAdobeSignSignedDocument activity below the GetAdobeSignRecipientStatus activity.
Specify the GetAdobeSignSignedDocument properties as follows:
-
Save the workflow locally and continue with the next set of steps.
Note
Adobe Sign provides signers the Decline to form fill option.
If the decline option is selected by the primary signer:
The signer will see a webpage (IFrame) stating "You declined to sign <PDF name>."
The signer will receive an email stating that Adobe Sign terminated the agreement exchange.
Adobe Sign will not return control of the sequence to Forms Builder and the workflow will not continue. The workflow will remain as a persisted instance. You will need to terminate persisted workflows periodically using either Sequence Designer (see Delete Persisted Workflow Instances) or Workflow Composer (see Persisted Workflows).
If the decline option is selected by the secondary or any additional signer:
The signer will see a webpage (IFrame) stating "You declined to sign <PDF name>."
The primary signer will receive an email stating that Adobe Sign terminated the agreement exchange.
Adobe Sign will return control of the sequence to Forms Builder and the workflow will continue. You can use the GetAdobeSignRecipientStatus activity to determine status of signers. If the status is “Cancelled”, the workflow can handle the sequence accordingly, e.g., with notification to a staff member.
To convert an Adobe Sign document to a DocumentEntity that can be attached to a record in Anthology Student, add CreateDocument and SaveDocument activities to the workflow. These activities will be placed below the GetAdobeSignSignedDocument activity.
-
Drop an If activity below the GetAdobeSignSignedDocument activity and specify the Condition as formInstance.ValidationMessages.HasErrors.
-
Add a LogLine activity to the Then branch using the following message Text:.
Environment.NewLine & "ERROR in GetSignedDocuments: " & formInstance.ValidationMessages.Item(0).Message
-
Create a variable named Doc. Set the Scope to StateMachine.
In the Variable type field, select Browse for Type. In the "Browse and Select a .Net Type" window, scroll down to Cmc.Nexus.Crm.Contracts > Cmc.Nexus.Crm.Entities and select DocumentEntity.
-
Drop a CreateDocument activity into the Else branch.
Specify the properties as shown below activity and use the drop-down field in the activity to select appropriate values:
-
Module = Select a Module from the drop-down list, e.g., Admissions.
-
Document Type = Select a Type (Template) from the drop-down list.
-
Document Status = Select a Type from the drop-down list.
-
Student = Specify a Student Id or use a variable.
-
Due Date = Specify a date or use a variable, e.g., DateTime.Now
-
Document (OutArgument) = Doc (This is the variable created above for the DocumentEntity.)
-
Validation Messages = formInstance.ValidationMessages
-
-
Below the CreateDocument activity, drop an Assign activity for each row in the following table and type the indicated values:
"To" Field Value Doc.OriginalFileName "AdobeSignPdf.Pdf" Doc.DocumentImage AdobeSignSignedDocument.Content Doc.ImageType "Pdf" Doc.IsDocumentAddedManually true -
Drop a SaveDocument activity below the last Assign activity.
Specify the properties for the SaveDocument activity as follows:
- Document (InOutArgument) = Doc (This is the variable created above for the DocumentEntity.)
- Validation Messages = formInstance.ValidationMessages
-
Save the workflow locally and continue with the next set of steps.
-
Click Publish. The New Workflow Definition Version window is displayed.
-
If you want the workflow to be run as soon as the event occurs on the entity, select Enable This Workflow Version?, otherwise leave the check box cleared.
-
Click Save, then Cancel to close the publisher window.
-
In the Sequence List, select and complete the form that contains the Adobe Sign fields.
-
Verify that the signed Adobe Sign document is available at the return URL.
Note: While testing your workflow, make sure that you terminate the previous instance of the workflow before running an updated version of the same workflow. In Workflow Composer, click Open Persisted Workflow, select your workflow instance, and click Terminate.
Persisted workflow instances can be also deleted from the Sequence Designer workspace. For more information, see Delete Persisted Workflow Instances.