Creating a simple process model with merge & redact

Overview

This guide will show you how to create a simple process model using the merge and redact smart services. They are two separate smart services, each representing a document processing step in your workflow. The smart services come out of the box with the Apryse PDFNet Smart Services. This guide is a simple example and you are free to use these services in your process model and workflow as you deem fit.

As a prerequisite, you should have the Apryse Smart Services Plugin installed.

Adding a Process Model

Go into the app in Appian where you want to add and use a process model for document processing from the Appian designer. You can even modify an existing one if you want.

Apryse Docs Image

If you are creating one from scratch, you can name it whatever you want. The default permissions should be fine but feel free to adjust this to the requirements of your app and organization.

Apryse Docs Image

Once created, Appian should take you into the process modeler.

Adding the Smart Services

Once loaded into the process modeler, you should presented with your workflow. If you created a new process model, there should be no services or steps in your model initially.

Apryse Docs Image

To add smart services from our Apryse PDFNet Smart Services Plugin, filter the service in the left panel using the input field at the top. Use the apryse search term to find all services that we provide.

Apryse Docs Image

We will add the Merge Documents and Search & Redact Documents services to the workflow for this example. We will first perform a merge first before redacting. This will redact from all merged document pages, but you can rearrange the steps so that redaction occurs on a certain document instead.

Apryse Docs Image

Configuring the Merge Smart Service

As the name suggests, the service merges multiple documents into one output document. We will need to tell the service what to merge and how to save. You can define process model parameters or variables that define which document to merge or even on how to save.

Apryse Docs Image

Parameters:

  • Document Ids - The IDs of the documents that will be merged together. You can use the document browser to look for the documents you want to merge.
  • Filename - The name of the file when saved to the system.
  • Save As New Document - Whether to save the merged document as a new document or overwrite the first of the input documents.
  • Save Folder Id - The ID of the folder where the merged output will be saved. You can use the document browser to look for the folder you want to save the document in.
  • Should Linearize Output - whether to linearize the document on save (read more in WebViewer best practices).

As outputs of the smart service, you will get the output document ID that could be stored in a variable, and used in another service or task further down the workflow.

Apryse Docs Image

There are also additional outputs for error handling if you want to enter an error case in your workflow.

Outputs:

  • Output Document ID - The ID of the merged output document. If Save As New Document is set to false, this will be the ID of the first document in the input list.
  • Has Error - Whether an error occurred or not.
  • Error Message - The error message of the error that occurred.

The input and output parameters listed here are subject to change in new versions of the smart service. Please refer to the actual parameters in the smart service you are using.

Saving the Output ID to a Process Variable

When the service merges the documents, you will get an output document ID. This ID can be saved to a process variable to be used in the next service. This is done by clicking on + icon next to the Target field.

Apryse Docs Image

You can change the variable name as needed here.

Apryse Docs Image

Configuring the Search & Redact Smart Service

The Search & Redact smart service is essentially a redaction service. It will search for a term and redact it from the document. The redaction term can be a string of the term to be redacted or a pattern defined as a regular expression. This will redact the found terms from all pages of the merged document.

Note that the output ID from the previous merge step can be saved to a process variable and provided as the document ID here. This is done with the following SAIL expression:

sh

1=document(pv!outputDocumentId, "id")

Apryse Docs Image

Parameters:

  • Document Ids - The IDs of the documents that will be redacted. You can use the document browser to look for the documents you want to redact.
  • Search Term - The term the service will look for to redact. This can take a regular expression.
  • Save As New Document - Whether to save the redacted document as a new document or overwrite the input document.
  • Save Folder Id - The ID of the folder where the redacted output will be saved. You can use the document browser to look for the folder you want to save the document in.
  • Prefix - The prefix to be added to the filename of the document after redaction. Only used if Save As New Document is set to true.
  • Suffix - The suffix to be added to the filename of the document after redaction. Only used if Save As New Document is set to true.
  • Should Linearize Output - whether to linearize the document on save (read more about linearize pdf file best practices)

The input and output parameters listed here are subject to change in new versions of the smart service. Please refer to the actual parameters in the smart service you are using.

As with the merge service, the outputs are the same.

Executing the Process Model

This process model can then be started with the startProcess function in Appian anywhere where it is needed. To summarize, this process model will first merge two documents together into a new file before redacting a term from all the pages of the merged document. This assumes you are providing the resulting output document from the previous step as the input to the next.

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales