Selective and Advanced Synchronization

The MFSQL Connector supports selective and advanced synchronization techniques to optimize metadata management and improve performance. This section provides an overview of the key concepts, strategies, and best practices for implementing selective and advanced synchronization within the connector.

Synchronization of specific parts

The procedure spMFSynchronizeSpecificMetadata allows for synchronizing specific parts of the metadata structure based on provided parameters. This procedure can be used to update specific classes, properties, or object types without affecting the entire metadata structure. This is particularly useful in scenarios where only a subset of the metadata has changed, allowing for more efficient updates and reduced processing time.

The procedure documentation include examples of how to use the parameters to target specific metadata elements for synchronization. By specifying the appropriate parameters, users can ensure that only the necessary updates are made, minimizing the impact on system performance and reducing the risk of errors.

This is particularly relevant for updating valuelist items, where changes may be frequent and localized. By using selective synchronization, users can ensure that valuelist items are kept up-to-date without the need for a full metadata refresh.

Metadata Structure Changes provides a practical example of using specific metadata synchronization when there are changes to the metadata structure in M-Files.

This procedure can also be used to update metadata structure elements from SQL to the M-Files vault. This is useful in scenarios where metadata structure changes are made directly in SQL and need to be reflected in the M-Files vault. The procedure can be used to perform different types of updates, including adding new elements, modifying existing elements, or deleting elements that are no longer needed and the type of update is determined by the type of metadata being synchronized.

The Name or alias for properties, valuelists, workflows and workflow states can be modified. Valuelist items use a separate procedure. Only existing items can be modified. New items must be added using the vault administration tools.

Synchronization of valuelist items

Valuelist items are a common element in M-Files metadata, and they often require frequent updates to reflect changes in the underlying data. The procedure spMFSynchronizeValueListItemsToMfiles is specifically designed to handle the synchronization of valuelist items between SQL and the M-Files vault. This procedure allows for the addition, modification, and deletion of valuelist items based on the data provided in the SQL tables.

The procedure can be used to add new valuelist items by specifying the appropriate parameters, including the valuelist ID, item name, and item value. It can also be used to modify existing valuelist items by providing the updated information for the item. Additionally, the procedure supports the deletion of valuelist items that are no longer needed.

The procedure documentation includes examples of how to use the parameters to manage valuelist items effectively. By using this procedure, users can ensure that their valuelist items are always up-to-date and accurately reflect the data in their SQL database.

Working with valuelist items in SQL

All valuelist items are stored in the table MFValueListItem. This table includes columns for the valuelist ID, item name, item value, and other relevant information. Users can interact with this table to manage their valuelist items directly from SQL. However, it is often more efficient to use a lookup that is specific to the valuelist being used.

The following procedures are useful when working with valuelist items in SQL: - spMFCreateValueListLookupView - Creates a view that provides a lookup for a specific valuelist. This view can be used to easily retrieve valuelist items based on their ID or name. - spMFCreateAllLookups - Creates lookup views for all valuelists in the system. This is useful for quickly accessing valuelist items without needing to join multiple tables manually. However, it is often more efficient to create a specific lookup for the valuelist being used.

Working with workflows and workflow states

Workflows and workflow states are important components of M-Files metadata, and they often require updates to reflect changes in business processes. The procedure spMFSynchronizeWorkflowsStates is designed to handle the synchronization of workflows and workflow states between SQL and the M-Files vault. This procedure allows for the addition, modification, and deletion of workflows and workflow states based on the data provided in the SQL tables. The following procedures are useful when working with workflows and workflow states in SQL: - spMFCreateWorkflowStateLookupView - Creates a view that provides a lookup for a specific workflow. This view can be used to easily retrieve workflow states based on their ID or name.

Working with additional or ad hoc properties

The procedure SpmfSetAdditionalProperty can be used to set or reset how an additional property behaves when being updated from SQL to M-Files. The switch will either retain the property or the metadata card, or remove it when it is null.

The procedure spMFDeleteAdhocProperty can be used to remove a property that is defined as an additional property from the class table and from the metadata card of all the objects in the class.