Skip to content
On this page

Task Workflow Actions

There are several different types of Workflow Actions that can be added to a Task which are listed below and broken up into two categories, Pre-Task Actions and Event Subscriptions.

Document Review

The Document Review Workflow Action (show in the image below) allows you to add a step to any individual document task that will enable the participant to download only the document for that task.

Document Review Workflow Action

To add the Workflow Action shown in the image above, you could use the following code:

csharp
task = new TaskInsertModel()
       {
           ...

           WorkflowActions = new List<object>
                             {
                                 new TaskWorkflowActionModel()
                                 {
                                     Type = TaskWorkflowActionModel.TypeEnum.DocumentReview,
                                     Description = "Document Review"
                                 }
                             }

           ...
       }

Upload Additional Attachments

It may be necessary to collect additional files (e.g. a scanned image of a drivers license, Social Security card, etc.) from your Participant during their process. The Upload Additional Attachments workflow action enables your Participant to upload required files during their process. Once they do this, the uploaded files will be tied into the Transaction and recorded on Signature Audit Trail as well. The attachments can then be accessed through the GetFileAttachments() API method. These attachments can also be added via the InsertFileAttachments() API method when using a Custom Workflow Action (or any other integration code) as well.

Upload Additional Attachments Workflow Action

To add the Workflow Action shown in the image above, you could use the following code:

csharp
task = new TaskInsertModel()
            {
                ...

                WorkflowActions = new List<object>
                {
                    new TaskWorkflowActionModel()
                    {
                        Type = TaskWorkflowActionModel.TypeEnum.UploadAdditionalAttachments,
                        Description = "Additional Documents",
                        Data = "FileTypesAllowed=.JPG,.GIF,.PNG,.PDF;MaxFileSize=2000;MaxFileCount=2;RequiredFileCount=2;"
                    }
                }

                ...
            }

The Data property is where you must indicate the upload configuration for the user. You can pass a string that contains one or more of these values separated by a semi-colon. All values MUST end with a semi-colon. The values are:

ParameterDescriptionType
FileTypesAllowed(optional) the file extension types allowed to be uploaded by the user. Separate types with a comma. Default is .doc,.docx,.pdf,.jpg,.gif,.png,.xls,.csv,.txtstring
MaxFileSize(optional) max upload file size in KB (decimals not allowed). Default is 2000.int
MaxFileCount(optional) the max number of files that a user can upload in the Work Flow Action page. Default is 1. Limit 10 per Workflow Action.int
RequiredFileCount(optional) the required number of files a user will be force to upload by the Work Flow Action page. This must be equal to or lower than the MaxFileCount value. Default is 0.int

Generic

The Generic Workflow Action (show in the image below) allows you to add a step to a Task that will enable you to create 100% of the content that shows up on the Workflow Action.

Generic Workflow Action

To add the Workflow Action shown in the image above, you could use the following code:

csharp
task = new TaskInsertModel()
       {
           ...
           WorkflowActions = new List<object>
                             {
                                 new TaskWorkflowActionModel()
                                 {
                                     Type = TaskWorkflowActionModel.TypeEnum.Generic,
                                     Content = "You can put <i>any</i> <b>HTML code</b> you would <b style=\"color:green\">like</b> here. <img src=\"https://img.com/img.png\">",
                                     ButtonTextPositive = "Continue",
                                     ButtonTextNegative = "Exit"
                                 }
                             }
           ...
       }

Custom

There are several main concepts to understand when using Custom Task Workflow Actions:

Adding a Custom Workflow Action to a Task

You may want to include a custom workflow action to a specific task in a participant's signing session. Likely reasons for this might include collecting and saving data from the participant that will be merged into the PDF prior to sign, requiring them to agree to some kind of legal disclosure, etc. The workflow action page DOES NOT need to be in the same installation as AlphaTrust® e-Sign (it cannot be for the SaaS service). It may reside on any other Website you choose.. That customer workflow action app just needs to be able to call the API to tell AlphaTrust® e-Sign that the workflow action step is completed (or wasn't completed as the case may be). You can also wrap the same branding around this page as on all of the other web pages in the signing process.

To add a customer Workflow Action to your Task, you could use the following code:

csharp
task = new TaskInsertModel()
       {
           WorkflowActions = new List<object>
                             {
                                 new TaskWorkflowActionModel()
                                 {
                                     Type = TaskWorkflowActionModel.TypeEnum.Custom,
                                     Description = "My Unique Form To Collect Data",
                                     Url = "https://mydomain.com/MyCustomWorkflowActionPage.php"
                                 }
                             }
       }

Setting Up a Custom Workflow Action

If you are going to use a custom Workflow Action for your participant, you may want the branding or "look and feel" of the page to be identical to all of the standard pages in the AlphaTrust® e-Sign process. You can use the GetProcessHtmlWrapper() API call to retrieve the HTML to use for your header and footer which is shown in the example below.

csharp
public ActionResult Index()
{
    int participantID = 0;
    int.TryParse(Request.QueryString["PartID"], out participantID); // Get the ParticipantID from the Querystring

    var req = new GroupHtmlWrapperRequestModel()
    {
        ParticipantID = participantID // assign it into the request model
    };

    var api = new HtmlWrapperApi(myRestEndpointUrl);
    var results = api.GetProcessHtmlWrapper(req, apiKey, apiSecret, apiUsername, apiPassword); // send it in with the request
    if (results.IsSuccessful.Value)
    {
        ViewBag.HeaderHtml = results.HtmlWrapper.HeaderHtml;  // use the return values for your header
        ViewBag.FooterHtml = results.HtmlWrapper.FooterHtml;  // and footer
    }
    else
    {
        // handle error
    }
    return View();
}

Custom Workflow Action

Updating PDF Document Form Fields

There may be times that you need to collect data from a participant during their process and then need to merge that data into the document prior to signing. You can use the UpdateDocumentFormFields() method to merge the name/value pairs into the document.

PropertyDescriptionType
DocumentIDThe id of the document you wish to merge the data into.int
FormFieldsA list of name/value pairs that are made up of the PDF Form Field names and the values you wish to merge into them.Array of FormFieldModel
csharp
var req = new DocumentUpdateFormFieldsRequestModel()
            {
                DocumentFormFields = new List<object>
                                     {
                                         new DocumentFormFieldsModel()
                                         {
                                             DocumentID = 1234567890,
                                             FormFields = new List<object>
                                                          {
                                                              new FormFieldModel()
                                                              {
                                                                  Name = "City",
                                                                  Value = "Dallas"
                                                              },
                                                              new FormFieldModel()
                                                              {
                                                                  Name = "State",
                                                                  Value = "TX"
                                                              }
                                                          }
                                         }
                                     }
            };

var api = new DocumentsApi(myRestEndpointUrl);
var results = api.UpdateDocumentFormFields(req, apiKey, apiSecret, apiUsername, apiPassword);

if (results.IsSuccessful.Value)
{
    // do work...
}
else
{
    // handle error
}

Completing a Custom Task Workflow Action

Once your participant has completed (or cancelled) the custom Workflow Action (possibly filling out form data that is merged into your document to be signed or just agreeing to a disclosure), you can let AlphaTrust® e-Sign know that the Workflow Action is complete using the UpdateTaskWorkflowActionStatus() method shown in the example below.

PropertyDescriptionType
IDThis is the ID of the Workflow Action which is also the instances of all Participant Workflow Actions in the transactions. You can get this value from the ps_actno querystring value.int
TaskIDYou can get this value from the SigID querystring value. (SigID and TaskID are synonymous)int
IsCompletedWhether or not the participant completed your custom Workflow Action.bool
csharp
var actionModel = new TaskWorkflowActionUpdateRequestModel()
                  {
                      WorkflowAction = new TaskWorkflowActionUpdateModel()
                                       {
                                           ID = actionID,  // ps_actno from querystring
                                           TaskID = taskID,  // SigID from querystring
                                           IsCompleted = true  // Is they completed, set to true. If they didn't, set to false
                                       }
                  };

var actionResults = serviceClient.UpdateTaskWorkflowActionStatus(sa, actionModel);

if (actionResults.IsSuccessful)
{
    // if request was valid, you will receive a return URL to redirect back into Pronto process.
    // This will happen for both complete or cancelled options
    return Redirect(actionResults.ReturnUrl);
}
else
{
    // handle error
}

Event Subscriptions

The remaining Task Workflow Actions are of a specialized type which are explained in detail in the Event Subscriptions section.