Config / Advanced Topics / Mapping Post-Processings

Mapping Post-Processings

Anveo EDI Connect has a powerful integrated EDI workflow system. For the standard cases you might want to use the Business Transactions. If you cannot model your workflow using those, there is also the concept of our, so called, Post-Processings, which are directly called from the mapping and can model any mapping workflow.

Like described in section Modelling Mapping Workflows, we usually use multiple mappings to process incoming or outgoing data. In the following sections, we describe the different possibilities to start another mapping (or business transaction) from the current one.

A post-processing is defined on a table loop in a mapping. Depending on the converter there might also be an option to start a mapping by using a command, but in this section we will assume that you have a mapping and want to post-process table data.

Let us take a typical example: You receive a file that contains multiple documents. The first mapping parses the file and create multiple records in our buffer table EDI Document. The line structure is also written into the table EDI Document Line. You usually want to process each document individually, so you define the post-processing on the document header table: EDI Document. The mapping processing the header structure can get the lines, by applying a suitable DataItemLink.

The post-process action is executed for each record that is processed in the mapping. For a table in write mode this means every record that is written. For a table in read mode it is executed for each read record. On tables in update mode, when you group data, you should usually avoid to define a post-processing, as the post-process action is executed for each update and not for each unique record. We have describes a way to handle this in the section Tips & Tricks.

Defining A Post-Process Action

In the mapping you have to find the correct table loop and go into the EDI Mapping Line properties. There is one property called Post-Processing. Please use the AssisEdit button, right to the value, to open the editor. You can create more than one post-processing, which you can use, for example, to send a confirmation message and also process the data in Anveo EDI Connect. Please use also in the list editor the AssisEdit button, to define the actual properties of the post-processing.

Type

You can choose the general type of the post-processing. The following options are available:

Process Mapping

The post-processing should execute another mapping with the current table data.

If you select this value other properties will become available.

Batch Processing (BT)

Mark the current record to be processed by a business transaction batch action. You can use this, for example, in a mapping that takes a system document and creates the buffer document to specify that the buffer document should be passed to the batch action. You can only mark one record in a mapping execution as the batch processing record.

This type does not have any additional properties.

Start Sub-Process (BT)

Starts a new sub-process with the current record. A sub-process requires an active business transaction and is shown as a child of the current one. Also the sub-process has to use the same table data as the current table loop. A sub-process will use the current partner and only set the reference number from the current data.

If you select this value a property will become available.

Start New Business Transaction

Starts a new business transaction with the current record. The business transaction has to use the same table data as the current table loop. The EDI Communication Partner is determined as defined in the business transaction type.

If you select this value a property will become available.

Business Transaction Type

This property is only available if the property Type is set to Start Sub-Process (BT) or Start New Business Transaction. Specifies the EDI Business Transaction Type that should be used.

Code

This property is only available if the property Type is set to the value Process Mapping. A code that is stored in the table EDI Processing Queue and can be used to filter the table.

Group Code

This property is only available if the property Type is set to the value Process Mapping. Only one post-processing is executed for each record of this line and group. So if you define multiple post-processings with the same group only the first one that is successful is executed.

Caption ML

This property is only available if the property Type is set to the value Process Mapping. The caption is multi-language enabled. It is shown in the EDI Processing Queue and if the user wants to reprocess a document.

Project Code

This property is only available if the property Type is set to the value Process Mapping. In this property you can specify the EDI Project of the mapping.

Format Code

This property is only available if the property Type is set to the value Process Mapping. This property specifies the EDI Format of the mapping.

Mapping Code

This property is only available if the property Type is set to the value Process Mapping. Specifies the code of the mapping that should be used.

Stay in Business Transaction

This property is only available if the property Type is set to the value Process Mapping and you are using Anveo EDI Connect 4.00 or newer. Specifies whether the post-processing is part of the current business transaction. You can set this to False to have post-processing, which are not directly related to the business transactions.

Process Manually

This property is only available if the property Type is set to the value Process Mapping. If you set this property to the value True the action will not run automatically and requires a user interaction. This is useful for testing.

Process Synchronously

This property is only available if the property Type is set to the value Process Mapping.

Please try to avoid using synchronous post-processings, they can cause table lock issues and are harder to understand if there are errors.

If you set the value of this property to True, the post-processing will run in the same database transaction than the current mapping. If there is an error in the post-processing it will be logged on the current mapping. Also the table EDI Processing Queue will be locked during the execution of the post-processing.

Run With Priority

This property is only available if the property Type is set to the value Process Mapping. If you set this property to the value True, the post-processing will run with a higher priority than the ones that don’t have this option set. You can use this to control the execution order.

Time Until Overdue

This property is only available if the property Type is set to the value Process Mapping. You can specify a timespan in which you expect the post-processing to be successful executed.

Tips & Tricks

If you want to run another mapping and do not have a suitable table loop, you can add the system table Integer in read mode and filter the column “Number” to one. Define the post-processing on this table.

The post-process mapping does not have to retrieve the post-processing record and can also work on other tables.

If you need to run post-process actions on record in update mode, where you group data, you can use the following trick to only execute the post-processing once per record: Please find an unused field in the table and set it to a value that is not used otherwise. You can then at the end of the mapping read the table with a filter on this field and value and this way only find records from the current mapping execution. Define the post-processing on this table and directly change the value back by putting another update line as child of the read line. As the whole mapping is executed in one database transaction you should only process the data you want to process, if you do not execute this mapping multiple times at the same time (which you should avoid because of table locking).