6.2.4. Document types
Documents provide a business-level view of the messages being processed.
In Babelway, messages typically represent the technical communication between two IT systems. To translate this technical traffic into meaningful business insights, you can define document types.
For instance, multiple channels may handle invoices in various formats and message types. Additional messages—such as those tracking the status or lifecycle of an invoice—can offer further context. By configuring document types, you can group these related messages and create a consolidated, business-focused view of your data.
For each document type created, a new menu item will appear in the monitoring section of your environment leading to a page listing your documents in a grid where each field of your document is displayed in a column.
This tab allows you to define which documents to track, customize the fields you want to display, and tailor how they appear in the interface.
Environment settings - DocumentTypes
Tell me more...
- Configuring a Document Type
- Document Fields
- Creating and Updating a Document
- Documents and Deployments
Configuring a Document Type
Document types have some shared configuration settings that involve general maintenance of the documents.
This will reference the technical name of your document. Please note that this name will be used as an identifier to reference your document type throughout the application. Modifying it will change the link between your document type and existing documents and document extractors. For changes to your document's display name, you can adapt its labels. |
|
This indicates how long the documents must be kept. The expiration date of the document is calculated at the documents initial creation time and cannot be modified afterwards. Thus, modifying this field, or updating documents later will not have any effect on the expiration date of existing documents. |
|
All the fields that you want to have for this DocumentType. For every field, you can choose its name and its type (see specific section on document fields). A special field called UniqueKey can be used uniquely identify a document. It can be used to enrich a document with multiple messages. It can also be used to link documents. |
You can also personalize how the interface will display your DocumentTypes.
By default, if you leave this field empty, all Documents will be displayed in the Monitoring section, with one menu entry by DocumentType. By using this parameter, you can group multiple DocumentTypes in just one menu section. The DocumentTypes will then be displayed as tabs in this menu section. To do this, simply add an id for the menu section. All the DocumentTypes with the same id will be grouped together. |
|
This parameter allows you to load labels that must be used, in any language, to display data related to this DocumentType. To do this, you must load a zip file containing a properties file (with all labels) for every language. Files in the zip must be named documents_[language].properties, or documents.properties for texts to use by default. By clicking on the link "Download file pattern", you can easily get an example file with all the correct keys already defined. |
|
Use a comma separated list of field names to define which ones to display by default upon opening your document list page. The names must be the name of a field. Note that the system fields can also be added ('id', 'creationMoment', 'lastUpdateMoment', 'keepUntil'). If you leave this field blank, the default is to display the columns for all of your fields, and id and creationMoment. The order of elements in the list has no importance. |
|
The criteria, on document creationMoment field, that will be applied by default when users come to the table of this DocumentType. If you choose for shorter values, the searches will be faster. For this reason, it is often better to choose short values, because users almost always access only recent documents, and let them change the criteria on the rare occasions when the users want to access old documents. |
|
The operators that will be applied for searches in the table. The expected format is a semicolon separated list of items of the form [fieldName]:[operators]. [operators] is a comma separated list of operators to display. Possible operators are 'eq' (equals), 'lt' (less than), 'le' (less or equal), 'gt' (greather than), 'ge' (greather or equal) or 'cn' (contains). Example of value : 'field1:eq,cn;field2:eq'. |
|
This allows you to break your document fields into sections on the document details page (Monitoring > Document > select a document). The value must have be formatted as follows: [Section1]field1,field2[Section2]field4,field3 For better readability, newLines are also accepted before every section. If you leave this field blank, the default is to display all the possible fields. |
Document Fields
Once you have set up the basic shared parameters of your document, you are going to want to tailor it to your specific use case. In particular, you are going to want to configure the fields that are specific to your documents. These fields have a name, and a field type. The name is a technical name (as it is for your document type name). It should not change and any effort to display it differently should be handled through labels. Document field types serve two purposes:
1. Data validity: Try to select the most specific field type in order to avoid bad values to make it into your documents. You don't want invoice totals for example to end up mistakenly containing address information. To avoid this, you'd set up your total as "Number" and any non number extractions would set your message in error and allow you to correct your extraction.
2. Filtering: The field type determines the filters and operations that will be available in your document grid. Strings will allow keyword searches, dates will allow you to select date intervals etc.
Babelway currently supports the following field types:
String |
This field type is the most common. Any kind of free text information can be stored here. |
String (choice within a list of values) | Using this field instead of the regular string will allow you to restrain values to a limited list of whitelisted ones. The filters in your document grid will then provide a dropdown for example to list only documents having one of those values. This is useful for example when wishing to configure a "status" for a document where the list of possibly values is known and you want them to match exactly one status. |
Integer | Field with this type will only be able to contain numbers without decimals. |
Number (with decimals) | Use this field in order to save numbers with decimals. |
Date | This using this field type will allow you to save a date. |
Date and time |
This field allows you to save a time. NB. When populating fields of this type, you can use the parseDateTime function. |
Partner |
If you have configured partners in your environment, this field type will allow you to link these documents to a given partner. You can use this field to restrict access to your documents based on partner data accesses. NB. When populating fields of this type, you can use the findPartner function. |
Partner Ids | Partner identifiers |
File |
This will allow you to attach a file to your document (for example, a PDF version of your business document). NB. In your document extractor, this field type will require populating the following information: |
IBAN account | IBAN stands for International Bank Account Number. This field type will guarantee that any account added here matches an IBAN format. |
Document reference | This field type will reference another document. In your document's detailed page, this field will be displayed as a link to another document. |
Creating and Updating Documents
Documents are created and updated during message processing using the document extractor extra processings on the message in and on the message out. Note that this is the only way to change document content. No manual changes are every possible.
If you are tracking your invoices and are also receiving updates to your invoice's status for example, you might want to track both the content and the status of your invoice in the same document view. This can be achieved by using a field named "UniqueKey" of type String:
You will need to choose a key that
- you are sure to be able to calculate from each message
- and that will be unique across your document type
For example, invoice number for an invoice document:
When you use this mechanism, the system will check for an existing document with this unique key. If it exists, the values you extracted will enrich the existing document. If not, it will create a new document. Thus you can update the same documents from multiple channels.
Documents and Deployments
If you are just getting started, then you don't have to worry about deployments. Document types, like lookup tables and certificates are automatically deployed.
So, as soon as you create or update a document type, it will appear in your monitoring section with the fields as you have configured them in this section.
When you wish to update document types however, your document configuration will change but your extractors will not be deployed. Thus, make sure to go back and adapt the channels that depend on this document structure.