DocuSign Workflow Sample - Multiple Signers
The following procedure details a sample workflow and forms for a sequence that contains multiple signers.
Prerequisites
-
The DocuSign properties are configured in Forms Builder. See DocuSign Settings.
-
A form sequence is created. In our example, the sequence includes the following forms:
-
Welcome
-
CMC_Student_Personal Info — This is an admissions application form that collects the personal data of a student and contains four DocuSign components (signature and date fields for two signers).
The signing process for the primary signer is the same as described in DocuSign Workflow Sample - Single Signer. The signing process for the primary signer is an embedded process within the form window. For the secondary signer, DocuSign 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 DocuSign request and the same envelop. DocuSign returns events when each signer signs the document and when the document is complete. The workflow responds to these events.
-
CoSigner — This form informs the student that a co-signer is needed and provides two text boxes for the co-signer's name and email address.
-
Default-Frame — This form contains an IFrame component with the following properties (case sensitive):
Name = docuSignFrame
Url = {{vm.models.frameUrl}}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. -
Default-DocuSignWait — This form is provided with the Forms Builder installation. It contains two HTML components.
The first HTML component displays the text "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 the following JavaScript code which disables the Next button until the co-signer's signature is received:
<script ng-if="!vm.models.signer2Complete" ng-cloak>
$(document).ready(function(){
var elem = $("[value='Automatically continues when all signatures collected']");
elem.css("cursor", "not-allowed");
elem.css("opacity", "0.65");
});
</script>The Default-DocuSignWait form will be overwritten when Forms Builder is upgraded.
Copy the original form, edit the copy, and use it in your sequences. Save a backup copy of your form.Note: Even though the Default-DocuSignWait form is provided for you, you must still add the Boolean argument signer2Complete that enforces the wait. The argument needs to be added in the transition after the DocuSignWait form.
In Forms Builder 3.7 and later, when any signer after the first/primary signer declines to sign the document, Webhook sets signer2Complete to false upon return to the form sequence. To handle this scenario in the workflow for the sequence, use the signer2Complete argument as a Condition in an If activity. By checking the signer2Complete value, the If Then/Else branches can then be designed as needed.
-
The Then branch would be entered if signer2Complete = true, i.e., all signers signed without issue and the signed document is retrieved.
-
The Else branch would be entered if signer2Complete = false, i.e., one of the signers declined. The subsequent activities could be to send an email notification to the first signer and/or update the document status in Anthology Student.
The argument signer2Complete needs to be defined in the Arguments tab. Be sure to match the casing in the JavaScript in the HTML component of the Default-DocuSignWait form. The argument is also used in the CreateDocuSignRequest (see below).
This logic can be repeated as needed for additional signers.
-
-
To optimize the display of your e-signature forms on mobile devices, you may want to add the CSS described in this Note.
Values in the Type Property
The DocuSign component provides additional values on the Type property: Approve, Attachment, Checkbox, Company, Date, Date Signed, Decline, Email, Email Address, Envelope Id, Full Name, Initial, Number, Signature, Ssn, and Text.
The DocuSign component provides an automatic transition (auto-redirect) from the Default-Frame form to the confirmation form after a successful DocuSign session. The auto-redirect obsoletes the "DocuSign Confirmation Message Text" setting.
The auto-redirect depends on a forward direction in the WaitForFormBookmark activity in the transition after the DocuSign redirect state (typically Default-Frame), in particular if DisplayName has been modified.
-
If there is only a single button and DisplayName has been customized but Transition Type was left as "Default", the auto-redirect moves forward to next form state.
-
If there are two buttons and DisplayName(s) have been customized but Transition Type was left as "Default", the auto-redirect will assume the rightmost button (alphabetically last) is the transition for next state.
As a best practice, specify the Display Order and Transition Type (“MoveForward” or “MoveBack”) when button Display Name(s) have been customized as the behavior will be known. The Transition Type of “Default” was kept for compatibility for forms built prior to Transition Type being available on WaitForFormBookmark with default Display Names "Next" and "Back”.
In sequences for multiple signers, you must set Transition Type = MoveForward on the WaitForFormBookmark activity in the transition from the Default-Frame form to the DocuSignWait form. See Transition from the IFrame Form to the DocuSignWait Form.
Enhancements in Forms Builder 3.6
The DocuSign component provides additional values on the Type property: Approve, Attachment, Checkbox, Company, Date, Decline, Email, Email Address, Envelope Id, Number, Ssn, and Text.
The DocuSign component provides an automatic transition (auto-redirect) from the Default-Frame form to the confirmation form after a successful DocuSign session. The auto-redirect obsoletes the "DocuSign Confirmation Message Text" setting.
The auto-redirect depends on a forward direction in the WaitForFormBookmark activity in the transition after the DocuSign redirect state (typically Default-Frame), in particular if DisplayName has been modified.
-
If there is only a single button and DisplayName has been customized but Transition Type was left as "Default", the auto-redirect moves forward to next form state.
-
If there are two buttons and DisplayName(s) have been customized but Transition Type was left as "Default", the auto-redirect will assume the rightmost button (alphabetically last) is the transition for next state.
Best Practice is always to specify Display Order and Transition Type (“MoveForward” or “MoveBack”) when button Display Name(s) have been customized so behavior is known. The Transition Type of “Default” was kept for compatibility for forms built prior to Transition Type being available on WaitForFormBookmark with default Display Names "Next" and "Back”.
In sequences for multiple signers, you must set Transition Type = MoveForward on the WaitForFormBookmark activity in the transition from the Default-Frame form to the DocuSignWait form. See Transition from the IFrame Form to the DocuSignWait Form.
Test the Multiple Signer Feature
To test the multiple signature feature with DocuSign, the test environment needs to meet specific requirements. DocuSign will try to call APIs on Renderer when secondary signers complete their signing process via email. This feature is referred to as Webhook and DocuSign Connect.
-
If you are testing with a DocuSign 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 DocuSign to communicate. You can request an exception from your IT team for port 80 or 443 for an IP address range. The IP address ranges used for demo accounts are listed at this link: https://trust.docusign.com/en-us/trust-certifications/ip-ranges/
-
-
If you are testing with a live DocuSign account:
-
Renderer must be hosted on port 443 (https).
-
If hosting Renderer on port 443 is not possible, a DocuSign 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.
Set Up DocuSign Account Preferences
The Multiple Signer feature requires a specific setting in your DocuSign account. To enable the feature, log in to your DocuSign account and navigate to Account Administration > Features. Select the DocuSign Connect check box. This feature must be enabled for the WebHook functionality to work.
Another setting that is available in your Anthology Student account is found under Manage Account > Email Notifications. Here you configure who receives the DocuSign email when the institution is a signer or a sender.
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 (as 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. |
|
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)
For example, to capture errors related to the CreateDocuSignRequest activity, you would place a LogLine activity with the following expression below the CreateDocuSignRequest activity.
Newtonsoft.Json.JsonConvert.SerializeObject(DocuSignRequest, 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 DocuSign 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 from the form that is used to collect the data, CMC_Student_Personal Info.
-
Set the Condition to True.
-
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.
In the following steps we add activities to the Next transition to create a PDF of the form.
-
Create a variable named URL. Set the Variable type to String. Set the Scope to StateMachine. This variable will be assigned to the PDF that will be created from the form.
Note: As of Forms Builder 3.5, the URL input argument for the PrintUrlToPdf activity is optional. When the URL is not specified, the activity constructs the URL for all forms traversed in the sequence.
-
Drop an Assign activity into the Entry area of the 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+Info"
Where "/forms=CMC_Student_Personal+Info" indicates the Forms Builder form that contains the DocuSign component.
Notes:
-
If the form name has a space, replace the space with a + sign as shown in the example: CMC_Student_Personal+Info
-
If multiple forms are sent to DocuSign, specify a comma-separated list of form names in the "/forms=" attribute.
-
-
-
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.)
Note: As of Forms Builder 3.5, the URL input argument for the PrintUrlToPdf activity is optional. When the URL is not specified, the activity constructs the URL for all forms traversed in the sequence.
-
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 Next transition from the CMC_Student_Personal Info form.
-
Create a variable named DocuSignConfig. 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 DocuSignConfig.
-
Drop a GetDocuSignConfig activity below the PrintUrlToPdf activity.
Specify the properties for the activity as follows:
- DocuSignConfig = DocuSignConfig
- Validation Messages = formInstance.ValidationMessages
The GetDocuSignConfig activity retrieves the User Name, Password, Integrators Key, and REST API Url from the DocuSign settings in Forms Builder. These values enable the workflow to log in to DocuSign.
To process the DocuSign request, the Email Subject and Return URL properties need to be assigned to the DocuSignConfig variable. These properties are required.
The only two properties for the DocuSignConfig object that should ever be modified in the workflow definition are EmailSubject and ReturnUrl. The values for all the other properties are retrieved from the DocuSign Settings saved in the database. Any modification done to the values for the other DocuSignConfig properties in the workflow definition will likely result in errors when the DocuSign portion of the sequence is executed. -
Create the following variables:
Variable Name Type Scope Default DocuSignRecipient Cmc.Nexus.FormsBuilder.Entities.
DocuSignRecipientStateMachine New DocuSignRecipient DocuSignRecipient2 Cmc.Nexus.FormsBuilder.Entities.
DocuSignRecipientStateMachine New DocuSignRecipient DocuSignDocument Cmc.Nexus.FormsBuilder.Entities.
DocuSignDocumentStateMachine New DocuSignDocument DocuSignRequest Cmc.Nexus.FormsBuilder.Entities.
DocuSignRequestStateMachine N/A -
Create the following argument:
- Name = signer2Complete
- Direction = In/Out
- Argument type = Boolean
-
Below the GetDocuSignConfig activity, drop an Assign activity for each row in the following table and type the indicated values:
"To" Field Value Notes DocuSignConfig.EmailSubject "CMC DocuSign Test at " + DateTime.Now.ToString() This is the email that the end user will receive after the signing process is done. DocuSignConfig.ReturnUrl formInstance.RendererBaseUrl
+"#/docusigncomplete"This is the URL that will display the document after the signing process is done. DocuSignDocument.DocumentId "1" The SignerId should match the Signer property in the DocuSign component on the form. Allowed values are "1" to "5". DocuSignDocument.Name "Student Info Pdf" Name of the signed document. DocuSignDocument.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. DocuSignRecipient.Name "RecipientName First" Name of the user who submitted the signed document. This could be the student name retrieved from the StudentEntity. DocuSignRecipient.Email "tester@anthology.com" Email address of the person who will receive the signed DocuSign document. This could be the email address retrieved from the StudentEntity. DocuSignRecipient.ConcealSSN True By default, the value is set to True, which masks the Ssn field value typed by the recipient. Set the value to False to display the typed value. DocuSignRecipient2.Name "RecipientName Second" Name of the co-signer who submitted the signed document. This could be a parent name from the StudentRelationshipAddressEntity. DocuSignRecipient2.Email "tester2@anthology.com" Email address of the co-signer who will receive the signed DocuSign document. This could be the email address retrieved from the StudentRelationshipAddressEntity. DocuSignRecipient2.ConcealSSN True By default, the value is set to True, which masks the Ssn field value typed by the recipient. Set the value to False to display the typed value. DocuSignRecipient2.SignerId "2" The SignerId should match the Signer property in the DocuSign component on the form. Allowed values are "1" to "5". DocuSignRecipient2.RoutingOrder "2" In Forms Builder 3.6 and later, you can set up a sequential routing order, where each recipient receives the email notification once the previous recipient has completed their action. You can also have a mix of sequential and parallel routing. To set a parallel order, such that some recipients receive the document at the same time, set the same value for the routing order.
When you use a routing order, you can also route an envelope to the same person multiple times. For example, you can send a document to student to approve, then send it on to a parent to sign, and finally send a copy the student again.
Prerequisite: You must have permission to create a routing order. See Allow Sequential Signing.
DocuSignRecipient2.
VariableToSetOnComplete"signer2Complete" The value "signer2Complete" is the argument created in the previous step. This argument is used as follows: On the DocuSignRecipient2 variable — When the secondary signer completes signing, DocuSign will send an event to the Forms Builder server, and the Forms Builder server will set the variable from false to true.
In the ResumeBookmark property of the CreateDocuSignRequest activity —See Note on the CreateDocuSignRequest activity. The string "Continue when all signatures are collected" is the value of the custom field named "Bookmark" that is returned by DocuSign.
- In the Done transition — See Receive the Signed Document.
In the JavaScript associated with the DocuSignWait form.
Note: Do not use VariableToSetOnComplete in single signer sequences.
"To" Field Value Notes DocuSignConfig.EmailSubject "CMC DocuSign Test at " + DateTime.Now.ToString() This is the email that the end user will receive after the signing process is done. DocuSignConfig.ReturnUrl formInstance.RendererBaseUrl
+"#/docusigncomplete"This is the URL that will display the document after the signing process is done. DocuSignDocument.DocumentId "1" The SignerId should match the Signer property in the DocuSign component on the form. Allowed values are "1" to "5". DocuSignDocument.Name "Student Info Pdf" Name of the signed document. DocuSignDocument.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. DocuSignRecipient.Name "RecipientName First" Name of the user who submitted the signed document. This could be the student name retrieved from the StudentEntity. DocuSignRecipient.Email "tester@anthology.com" Email address of the person who will receive the signed DocuSign document. This could be the email address retrieved from the StudentEntity. DocuSignRecipient2.Name "RecipientName Second" Name of the co-signer who submitted the signed document. This could be a parent name from the StudentRelationshipAddressEntity. DocuSignRecipient2.Email "tester2@anthology.com" Email address of the co-signer who will receive the signed DocuSign document. This could be the email address retrieved from the StudentRelationshipAddressEntity. DocuSignRecipient2.SignerId "2" The SignerId should match the Signer property in the DocuSign component on the form. Allowed values are "1" to "5". DocuSignRecipient2.
VariableToSetOnComplete"signer2Complete" The value "signer2Complete" is the argument created in the previous step. This argument is used as follows: On the DocuSignRecipient2 variable — When the secondary signer completes signing, DocuSign will send an event to the Forms Builder server, and the Forms Builder server will set the variable from false to true.
In the ResumeBookmark property of the CreateDocuSignRequest activity —See Note on the CreateDocuSignRequest activity. The string "Continue when all signatures are collected" is the value of the custom field named "Bookmark" that is returned by DocuSign.
- In the Done transition — See Receive the Signed Document.
In the JavaScript associated with the DocuSignWait form.
Note: Do not use VariableToSetOnComplete in single signer sequences.
-
Save the workflow locally and continue with the next set of steps.
In the following steps we will continue to add activities to the Next transition from the CMC_Student_Personal Info form.
-
Drop the CreateDocuSignRequest activity below the previous activity.
Specify the properties for the CreateDocuSignRequest activity using the names of the variables created above as follows:
Notes:
-
The expression for DocuSignRecipients passes multiple items (the primary and secondary recipient) within an array.
-
The ResumeBookmark value will be passed to DocuSign as a custom field. When the envelope has been completed, DocuSign will return this flag and any process that has to happen after the bookmark can resume automatically without any user intervention.
-
The out argument DocuSignRequest returns the envelope Id and URL of the signed DocuSign document.
-
-
Drop an Assign activity below the CreateDocuSignRequest activity.
-
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 DocuSignRequest.Url.
-
-
Save the workflow locally and continue with the next set of steps.
The IFrame form (Default-Frame) will receive the DocuSign document with the first signature, but the signing process is not yet complete. We want the workflow to continue with the DocuSignWait form upon receipt of the first signature. The workflow will pause on the DocuSignWait 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 DocuSignWait form.
-
Double-click the transition from the Default-Frame form to the DocuSignWait form.
-
In the Trigger area, name the WaitForFormBookmark as Continue.
-
Select the property Transition Type = MoveForward on the WaitForFormBookmark activity.
-
Specify the Condition as Not formInstance.ValidationMessages.HasErrors.
-
Save the workflow locally and continue with the next set of steps.
In the following steps we will create activities in the Submit transition which follows the IFrame form.
-
Double-click the T1 transition after the Default-Frame state and rename it as Submit.
-
Drop a WaitForFormBookmark activity into the Trigger area of the Submit transition.
-
Rename the WaitForFormBookmark activity as Submit.
-
Create a variable named SignedDocument. In the Variable type field, select DocuSignDocument. Set the Scope to StateMachine.
-
Create another variable named SignedDocumentList. In the Variable type field, select List Collection (system.collection.Generic.List<T>) and inside the List, select the DocuSignDocument Entity (Cmc.Nexus.FormsBuilder.Entities.DocusignDocument). Set the Scope to StateMachine.
-
Drop a GetSignedDocument activity below the Submit activity.
Specify the properties for the activity as follows:
-
DocusignConfig = DocusignConfig (This is the variable created for the DocusignConfig Entity)
- DocuSignDocument = SignedDocument (This is the name of the variable created above.)
-
DocusignDocumentList = SignedDocumentList (This is the name of the variable created above.)
- EnvelopeId = DocuSignRequest.EnvelopeId
-
ReturnList = True
- Validation Messages = formInstance.ValidationMessages
Workflow Composer automatically wraps the activities in a Sequence.
-
-
Save the workflow locally and continue with the next set of steps.
Note: If it is necessary to troubleshoot the receipt of the signed document, you might want to consider the procedure of Write the PDF to Disk.
In the following steps we will create activities in the Submit transition which follows the IFrame form.
-
Double-click the T1 transition after the Default-Frame state and rename it as Submit.
-
Drop a WaitForFormBookmark activity into the Trigger area of the Submit transition.
-
Rename the WaitForFormBookmark activity as Submit.
-
Create a variable named SignedDocument. In the Variable type field, select DocuSignDocument. Set the Scope to StateMachine.
-
Create another variable named SignedDocumentList. In the Variable type field, select List Collection (system.collection.Generic.List<T>) and inside the List, select the DocuSignDocument Entity (Cmc.Nexus.FormsBuilder.Entities.DocusignDocument). Set the Scope to StateMachine.
-
Drop a GetSignedDocument activity below the Submit activity.
Specify the properties for the activity as follows:
-
DocusignConfig = DocusignConfig (This is the variable created for the DocusignConfig Entity)
- DocuSignDocument = SignedDocument (This is the name of the variable created above.)
-
DocusignDocumentList = SignedDocumentList (This is the name of the variable created above.)
- EnvelopeId = DocuSignRequest.EnvelopeId
-
ReturnList = True
- Validation Messages = formInstance.ValidationMessages
Workflow Composer automatically wraps the activities in a Sequence.
-
-
Save the workflow locally and continue with the next set of steps.
Note: If it is necessary to troubleshoot the receipt of the signed document, you might want to consider the procedure of Write the PDF to Disk.
In the following steps, we will create activities in the Done transition which follows the DocuSignWait form. At this point in the workflow, the second signature was received and the DocuSign document is complete.
-
Double-click the Done transition after the DocuSignWait state and rename the WaitForFormBookmark activity as Continue when all signatures are collected. DocuSign returns the string "Continue when all signatures are collected" in the custom field named "Bookmark".
-
Specify the Condition as signer2Complete. Only when the sign2complete variable is set to true, the user can proceed with the sequence.
-
Create a variable named SignedDocument. In the Variable type field, select DocuSignDocument. Set the Scope to StateMachine.
-
Drop a GetSignedDocument activity into the Action area.
Specify the properties for the activity as follows:
- DocuSignDocument = SignedDocument (This is the name of the variable created above.)
- EnvelopeId = DocuSignRequest.EnvelopeId
-
Save the workflow locally and continue with the next set of steps.
Note: If it is necessary to troubleshoot the receipt of the signed document, you might want to consider the procedure of Write the PDF to Disk.
Content in this section is not available in version 4.0.
In the following steps we will create activities in the Submit transition which follows the IFrame form to fetch the data submitted by signers and add the data in the renderer log.
-
Create a variable named TagName. In the Variable type field, select String. Set the Scope to StateMachine.
-
Create a variable named Value. In the Variable type field, select String. Set the Scope to StateMachine.
-
Create a variable named DocuSignRecipients. In the Variable type field, select Array of <T> and from the T dropdown, select Cmc.Nexus.FormsBuilder.Entities.DocuSignRecipient. Set the Scope to StateMachine.
-
Create a variable named DocuSignFormData. In the Variable type field, select the List Collection (system.collection.Generic.List<T>) and inside the List select the DocuSignFormDataitem Entity(Cmc.Nexus.FormsBuilder.Entities.DocuSignFormDataitem.). Set the Scope to StateMachine.
-
Drop a GetDocuSignRecipientFormData activity below GetSignedDocument activity.
Specify properties for the activity as follows:
-
DocuSignConfig = DocuSignConfig (This is the variable created for DocusignConfig Entity)
-
DocuSignRecipients = DocuSignRecipients (This is the variable created above)
-
EnvelopeId = DocusignRequest.EnvelopeId
-
ValidationMessage = forminstance.ValidationMessages
-
-
Drop a ForEach<> activity below the GetDocuSignRecipientFormData activity. Specify the TypeArgument as Cmc.Nexus.FormsBuilder.Entities.DocuSignRecipient And Values as ‘DocuSignRecipients’ (This is the name of the variable created above).
-
Drop an Assign activity inside the ForEach<> activity, and specify the following values:
-
To = DocuSignFormData
-
Value = item.FormData
-
-
Drop a ForEach<> activity below the Assign activity.
Specify the TypeArgument as Cmc.Nexus.FormsBuilder.Entities.DocuSignFormDataItem.
Specify the Value as in ‘DocuSignFormData (This is the name of the variable created above)
-
Drop an Assign activity inside the ForEach<> activity, and specify the following values
-
To = TagName
-
Value = item.TagName
-
-
Drop an Assign activity inside the ForEach<> activity, and specify the following values:
-
To = Value
-
Value = item.Value
-
-
Drop a Logline activity and specify the following values:
-
Text = "Formdata Tagnames and Values are :"& Tagname & Value
-
Level = Information
-
To convert a DocuSign document to a DocumentEntity that can be attached to a record in Anthology Student, add the CreateDocument and SaveDocument activities to the workflow. To attach multiple documents/attachments in Anthology Student, add the CreateDocument and SaveDocument activity in a ForEach<> loop. These activities will be placed in the Submit transition.
-
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 ForEach<> activity below the ForEach<> activity dropped below the GetDocuSignRecipientFormData activity.
Specify the Foreach <item> in ‘SignedDocumentList’ (This is the name of the variable created above).
-
Drop an If condition activity inside the Foreach<> Activity. Specify the condition as “item.Name = "Student Info"”.
Note: Student Info is the name of the signed pdf document in the assign activity that was specified by the user in Get the DocuSign Configuration and Pass the Recipient Information.
The If condition ensures that the signed pdf document is saved in the Document Center in Anthology Student and all attachments attached by the signer along with the signed summary report are also saved to the Document Center in Anthology Student. -
Drop a CreateDocument activity and specify the following under the Then condition:
Specify the required properties for the activity as follows:
- Module = Select a Module from the drop-down list.
- 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.DocumentImage SignedDocument.Content Doc.OriginalFileName "Signedpdf.Pdf" Doc.ImageType "Pdf" Doc.IsDocumentAddedManually true -
Drop a SaveDocument activity below the CreateDocument 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
-
In the Condition field of the Submit transition, specify the following (to prevent users from submitting a form that has validation errors): Not formInstance.ValidationMessages.Has Errors
-
Save the workflow locally and continue with the next set of steps.
-
Drop a CreateDocument activity and specify the following under the Else condition:
Specify the required properties for the activity as follows:
- Module = Select a Module from the drop-down list.
- 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.DocumentImage SignedDocument.Content Doc.OriginalFileName "Signedpdf.Pdf" Doc.ImageType "Pdf" Doc.IsDocumentAddedManually true -
Drop a SaveDocument activity below the CreateDocument 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
-
In the Condition field of the Submit transition, specify the following (to prevent users from submitting a form that has validation errors): Not formInstance.ValidationMessages.Has Errors
- Save the workflow locally and continue with the next set of steps.
To convert a DocuSign 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 GetSignedDocument activity.
-
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 below the GetSignedDocument activity.
Specify the required properties for the activity as follows:
- 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.AddDays(2)
- 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 SignedDocument.Name + "1.pdf" Doc.DocumentImage SignedDocument.Content Doc.ImageType "Pdf" Doc.IsDocumentAddedManually true -
Drop a SaveDocument activity below the CreateDocument 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
-
Drop a SendMail activity below the SaveDocument activity.
Specify the properties for the SaveDocument activity as follows:
- Body = "Continue with next form at http://www..." (or similar message text as needed to direct the student to the next steps in the process)
- From = testing@anthology.com (email address of the institution)
- Subject = "Signatures received" (or similar subject text)
- To = "tester@anthology.com" (email address of the student)
-
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 DocuSign fields.
-
Verify that the signed DocuSign 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.
In Forms Builder 3.6 and later, persisted workflow instances can be deleted from the Sequence Designer workspace. For more information, see Delete Persisted Workflow Instances.