Skip to main content

Data Masking with eBA Plus AI: Related Documents

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

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

Introduction

In this process, an associated documents object is added to the form within the process. As soon as a document is added to the related documents object while using the process, the masked version of the document is added to the location specified in the process on the DM side.

Document Management

On the document management side, the Data Masking library and the Related Documents folder should be created under it, where the documents added to the Related Documents object on the form and the AI-masked version of these documents 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 side can be left as it is, the actual operations will be done on the form side.

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'

Designing a Form

A Related Documents object is added to the form in the process. From the Actions tab of the object, select the Add**, Delete, and View.

Then the OnAfterRelation event of the object opens.

Then, the following values should be added to the using definitions of the form 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
}
};

Then, the following codes should be added to the OnAfterRelation event of the associated documents object on the form.

'''csharp public void IliskiliDokumanlar1_OnAfterRelation(object sender, eBARelationFileEventArgs e) { eBAConnection con = CreateServerConnection(); con. Open();

string path = "Data Masking/Related Documents/" + Path.GetFileName(e.Filename); con. FileSystem.CreateMaskedDocument(e.Filename, showOptions, path);

con. close(); }

After this stage, the project should be compiled.

## Operation
When the process is opened, a document is added to the associated documents object, at which time the document is masked and the masked version is copied to the DM location specified in the process.

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