Version Control
It is important to understand OMD’s locking mechanism before implementing an interface to OMD. Unforeseen or incorrect updates from external systems can severly corrupt the workflow and lifecycle of OMD elements.
OMD provides an optimistic locking mechanism by means of the version column. Each entity instance (record) in OMD has a version, starting with 1 when the instance is created and increased by 1 each time the instance is updated.
When OMD clients try to update instances, the provided version number will be compared with the version number in the OMD database. If the version number in the database is higher than the uploaded version number, the upload will fail and a Version Mismatch will be reported.
Whether the external system is allowed to update an entity depends on business requirements. Typically, updates of Task data is not allowed, while updates of replicated master data usually is.
If an external update of an entity instance is allowed, i.e. the ERP system can overwrite the content of an instance in OMD, the corresponding element in posted XML documents should never provide the version attribute. In that case, OMD will not be able to verify the version number and all external updates will be executed without comparing the version number. This mechanism is often useful when posting product lists or inventory items which are maintained within the ERP system. Updates within OMD should not occur for this type of entities.
If no updates are allowed, the external system must send a version attribute with value 0
. This will always differ from the version number of the instance in OMD. Hence, no external updates will ever be allowed. Refer to the Configuration Management document on how to suppress version mismatch error messages during uploads. This mechanism must be used for the Task entity, since uploaded tasks will be exclusively changed by OMD once the task is available in OMD. Status updates on tasks in external systems should always occur by means of downloaded outbound task attachments (see below for details).