Skip to main content

Data Masking with eBA Plus AI: Files

This document exemplifies how to use the AI data masking structure on the Files object in eBA Plus.

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

Introduction

In this process, a files object is added to the form in the process, a document is added to this object when the process is used, and the document is masked with AI when the flow is continued. Then, later in the process, users in the flow will see this masked document.

Document Management

On the document management side, an AI library should be created where the document added to the Files object will be kept masked with AI.

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. Before coming to the next approver, the document added to the files object will be masked with AI and the masked document will be transferred to the 'Document1' object and the approver will see this 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; using System.Linq;


*The 'System.Linq' library is required to use the 'Last()' function in the method we use to get the path information of the document added to the files object.*

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
}
};

Then, the content of the function object added to the flow should be as follows. This code block masks the document added on the files object and saves it under the AI library on the DM specified in the code block, adding the value [MASKED] to the beginning of its name. The path of the saved document is assigned to the path value of the Document1 object.

'''csharp public void maskAttachments_Execute() { string viewName = "default";

eBAConnection con = CreateServerConnection(); con. Open()

DMFile file = con. FileSystem.GetWorkflowFile(Doc1.ProfileId); DMCategoryContentCollection attachments = file. GetAttachments(viewName);

foreach (DMFileContent attachment in attachments) { string attachmentPath = file. Path + "?content=" + attachment. Name; string extension = Path.GetExtension(attachmentPath.Split('?'). Last(). Split('='). Last()); string filename = @"AI/[MASKED] " + Process + "-" + ProcessId.ToString() + extension; DMFile maskdDocument = con. FileSystem.CreateMaskedDocument(attachmentPath, showOptions, filename); Document1.Path = maskdDocument.Path;
}

con. close(); }


*The path structure is slightly different from the standard DM path structure as the documents added on the Files object are kept on the form and not on the DM, but since data masking with eBA Plus AI supports all path structures on the DM, the 'attachmentPath' variable in the code block above will produce a path in the following format.*

'workflow/eBAAIAttachments/Form/1234.wfd?content=attachments/default/biography_document_copy.pdf'

## Designing a Form
It is sufficient to add a **Files** object to the form in the process.

![](https://docsbimser.blob.core.windows.net/imagecontainer/attachments-form-36c73697-660a-4503-a9f4-64058a0c8c96.png)

After this stage, the project should be compiled.

## Operation
When the process is opened, a document is added to the files object, as soon as the flow is sent to the next approver, this document is masked and the masked version is copied to the DM location specified in the process. The next approver is then shown the masked version of this document added.

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**.