Skip to main content

Data Masking with eBA Plus AI: Masking the PDF Version of the Form

This document exemplifies the AI data masking structure in eBA Plus, which allows you to fill out an eBA form and see the masked '*.pdf' version of it the next approver of the flow.

Before reading this document eBA Plus Data Masking with AI Document should be read.

Introduction

In this process, fields containing sensitive information will be added to a form in the process, this form will be converted to '.pdf' on the flow at the time of use, and then the converted '.pdf' will be masked with AI, allowing the next approver to see the masked version of the '*.pdf' version of the form.

Document Management

On the document management side, an .pdf library should be created in the process where the '' version of the form and the AI masked version of this '.pdf' document will be kept.

Designing the Workflow Process

A new process is defined in Workflow Studio. A Workflow Project type process will be sufficient for the example to be made.

The flow should be as follows. When the form is sent to the next step from the flow initiator, it should be converted to '.pdf' with the Export to PDF object and assigned to the Document1 object. This newly created '.pdf' is masked on the Function object on the flow with AI through the Document1 object, and the masked '*.pdf' file is transferred to the Document1 object again, and the next approver is allowed to see the masked document.

Then, in Workflow Studio, right-click on the Project and add eBAPI.dll as a reference from the Project Properties -> Reference Files tab, as follows.

  • '%SystemPath%\Common\eBAPI.dll'

Then, the following values should be added to the using definitions of the flow code.

'''csharp using eBAPI; using eBAPI.Connection; using eBAPI.DocumentManagement;


Then, these values are defined in which category of data will be masked in the document.

'''csharp
List```<```MaskedDataOption```>``` showOptions = new List```<```MaskedDataOption```>```
{
new MaskedDataOption
{
Category = DataCategories.Unknown,
ActionType = DataMaskingActionTypes.Change,
ActionValue = "[UNKNOWN]",
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.FullName,
ActionType = DataMaskingActionTypes.ShowOnlyFirstCharacters,
ActionValue = null,
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.Address,
ActionType = DataMaskingActionTypes.Change,
ActionValue = "[HIDDEN]",
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.Email,
ActionType = DataMaskingActionTypes.Hide,
ActionValue = null,
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.NationalIdNumber,
ActionType = DataMaskingActionTypes.RestrictedShow,
ActionValue = null,
RestrictedShowOptions = new Dictionary```<```DataRestrictedShowOptions, int```>```
{
{DataRestrictedShowOptions.ShowFirstXCharacters, 3}
}
},
new MaskedDataOption
{
Category = DataCategories.TaxNumber,
ActionType = DataMaskingActionTypes.RestrictedShow,
ActionValue = null,
RestrictedShowOptions = new Dictionary```<```DataRestrictedShowOptions, int```>```
{
{DataRestrictedShowOptions.ShowLastXCharacters, 3}
}
},
new MaskedDataOption
{
Category = DataCategories.SocialSecurityNumber,
ActionType = DataMaskingActionTypes.RestrictedShow,
ActionValue = null,
RestrictedShowOptions = new Dictionary```<```DataRestrictedShowOptions, int```>```
{
{DataRestrictedShowOptions.ShowFirstLastXCharacters, 3}
}
},
new MaskedDataOption
{
Category = DataCategories.CreditCardNumber,
ActionType = DataMaskingActionTypes.RestrictedShow,
ActionValue = null,
RestrictedShowOptions = new Dictionary```<```DataRestrictedShowOptions, int```>```
{
{DataRestrictedShowOptions.HideFirstXCharacters, 3}
}
},
new MaskedDataOption
{
Category = DataCategories.Iban,
ActionType = DataMaskingActionTypes.RestrictedShow,
ActionValue = null,
RestrictedShowOptions = new Dictionary```<```DataRestrictedShowOptions, int```>```
{
{DataRestrictedShowOptions.HideLastXCharacters, 3}
}
},
new MaskedDataOption
{
Category = DataCategories.BankAccountNumber,
ActionType = DataMaskingActionTypes.Hide,
ActionValue = null,
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.InstitutionName,
ActionType = DataMaskingActionTypes.RestrictedShow,
ActionValue = null,
RestrictedShowOptions = new Dictionary```<```DataRestrictedShowOptions, int```>```
{
{DataRestrictedShowOptions.ShowFirstXCharacters, 1}
}
},
new MaskedDataOption
{
Category = DataCategories.Country,
ActionType = DataMaskingActionTypes.Change,
ActionValue = "[COUNTRY]",
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.City,
ActionType = DataMaskingActionTypes.Change,
ActionValue = "[CITY]",
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.IPAddress,
ActionType = DataMaskingActionTypes.RestrictedShow,
ActionValue = null,
RestrictedShowOptions = new Dictionary```<```DataRestrictedShowOptions, int```>```
{
{DataRestrictedShowOptions.ShowFirstLastXCharacters, 2}
}
},
new MaskedDataOption
{
Category = DataCategories.Date,
ActionType = DataMaskingActionTypes.Change,
ActionValue = "[DATE]",
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.InvoiceNumber,
ActionType = DataMaskingActionTypes.ShowOnlyFirstCharacters,
ActionValue = null,
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.Website,
ActionType = DataMaskingActionTypes.Change,
ActionValue = "[LINK]",
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.Salary,
ActionType = DataMaskingActionTypes.Hide,
ActionValue = null,
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.Amount,
ActionType = DataMaskingActionTypes.Change,
ActionValue = "[AMOUNT]",
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.BankName,
ActionType = DataMaskingActionTypes.ShowOnlyFirstCharacters,
ActionValue = null,
RestrictedShowOptions = null
}
};

The codes of the Export to PDF object should be as follows.

'''csharp public void PDFeAktar1_Execute() { <#eBA Workflow Studio created code begin> -- do not remove eBAConnection con = CreateServerConnection(); con. Open(); try { PDFExport ebapdfexport = new PDFExport(con);

Documents to export ebapdfexport. AddDocument(Doc1.Path, "default"); ebapdfexport. Export();

Save exported document string filename = @"AI/" + Process + "-" + ProcessId.ToString() + ".pdf"; ebapdfexport. SaveToDMFileSystem(filename); Doc1.Path = filename; } finally { con. close(); } <#eBA Workflow Studio created code end> -- do not remove }


Then, the following codes should be added to the function object in the flow.

'''csharp
public void maskForm_Execute()
{
eBAConnection con = CreateServerConnection();
con. Open()

DMFile file = con. FileSystem.CreateMaskedDocument(Doc1.Path, showOptions);
Document1.Path = file. Path;

con. close();
}

Designing a Form

The form in the process should contain sensitive information as in the image.

After this stage, the project should be compiled.

Operation

When the process is opened, the fields that should contain sensitive information added to the form are filled in, then sent to the next approver. At this stage, the form is transferred to '.pdf', which is then sent to the '.pdf' to mask sensitive information. When it comes to the last approver, the approver will see the masked version of the generated '*.pdf'.

The masking process may take an average of 15-20 seconds depending on the document size. In case of an error, it can be tracked from the Workflow Service category on the Event Log Viewer.