Create extension (SAPCreateDocumentExtension)

The extension is responsible for iterating the ImageMaster SAP transfer configurations, checking if conditions in the configuration apply to the document currently processed and to create transfer jobs. Later, these entries are used by the SAP Messenger to register an ImageMaster document to SAP.

Functional description of the different checks processed in the extension for a transfer configuration is as follows. If all checks have a positive outcome a transfer job will be created.

Processing, transaction, and compensation functions

  1. The create extension has to use the afterPersistence extension point to be sure that the document has been created completely.

  2. The create extension has to be processed by the functions createDocument and createDocuments.

  3. The createDocuments function processes a list of documents and creates them one by one. This function can be used with a batchId, i.e. the archiving of all documents being created with the batchId belongs to a logical transaction. They can be discarded by canceling the batch. It results in automatically deleting all the documents created with this batchId. The compensation is carried out by the container rollback.

  4. Documents created with one call to the createDocuments function are created within a transaction (DB transaction). Also the documents created by the create extension (in alis_messenger) belong to that transaction.

  5. No matter how createDocuments is used (with or without batchId), the failure of persisting one document results in the rollback of all documents in the list created so far (also the documents created in an extension).

  6. The createDocument function can also be used with a batchId. Special compensation functions are not required because the processing is done within the current transaction or by using a batchId (see above).

  7. If the extension encounters an error creating an entry in the alis_messenger table a DocumentException will be thrown resulting in a rollback of the document creation.

  8. If the extension encounters an error in checking the transfer condition a log entry will be written to the ImageMaster log file. No SAP Messenger exception will be thrown.

See below the Sap Messenger extension checks.

Extension Check

Description

isEnabled

Checks if the configuration is enabled. If not, skips configuration.

imaDocumentType

Checks if the ImageMaster DocumentType is equal to the one the incoming document belongs to. If yes, proceed else skip configuration.

transferConditions

If any transfer conditions exist process them. A negative outcome of one condition will exit the extension and result in log message that the document has not been booked for SAP registration.

Table 230: Create extension checks

At this processing stage, no data checks are performed concerning the existing index field, except for the one specified in the transfer conditions. The extension is mandatory and is loaded by the SAPMessenger installer, but is not included in the extensions.xml file.