Use Case: Manage Configuration Data

Prev Next

For: Customers · Partners · Integrators

Product configuration in orderManager is controlled through custom tables in Configuration Data Management (cDM) libraries, for example surfaces, surcharges, or available boards. The values come from a system of record and need to stay up to date.

Challenge

When configuration values are maintained manually, configurators may offer surfaces that are no longer available or use outdated surcharges. Material data already available in materialManager is maintained twice.

Solution

The system of record reads and replaces the contents of custom tables through the Configuration Data Management API. Tables linked to materialManager are updated through synchronization instead.

Method Purpose
GET .../libraries List libraries. The library's name is its identifier.
GET .../libraries/{libraryId}/customTables List a library's custom tables.
GET .../customTables/{customTableId}/structure Read column definitions and the structure ETag.
GET .../customTables/{customTableId}/data Read all rows and the content ETag.
PUT .../customTables/{customTableId}/data Replace the complete contents of the table.
POST .../customTables/{customTableId}/sync Start synchronization with materialManager.
GET .../customTables/{customTableId}/sync/{correlationId} Read the status of a synchronization.

All routes begin with /api/orderManager/configurationDataManagement. URL-encode the library name and table ID as separate path segments.

Workflow

  1. Identify the library and custom table. Use the table's id, not its display name.
  2. Read the structure to find out the column IDs and types.
  3. Read the current contents, including the eTag.
  4. Change the rows in your system.
  5. Send all rows back with the eTag. Check succeeded in the result.
var cdm = new ConfigurationDataManagementClient(subscriptionId, authorizationKey);

// 1. Identify the library and table
var libraries = await cdm.GetLibraries();
var tables = await cdm.GetCustomTables("Production library");

// 2. Read the structure
var structure = await cdm.GetCustomTableStructure("Production library", "cabinet-finishes");

// 3. Read the current contents
var data = await cdm.GetCustomTableData("Production library", "cabinet-finishes")
    ?? throw new InvalidOperationException("No table content was returned.");

// 4. Change a value
var row = data.Rows.Single(r => r.RowId == "finish-oak");
row.Cells.Single(c => c.ColumnId == "surcharge").Value = "15.0";

// 5. Send all rows back with the ETag
var result = await cdm.SetCustomTableData("Production library", "cabinet-finishes",
    new SetCustomTableDataRequest { ETag = data.ETag, Rows = data.Rows });

if (!result.Succeeded)
{
    throw new InvalidOperationException(result.Message);
}
# 3. Read the current contents
GET /api/orderManager/configurationDataManagement/libraries/Production%20library/customTables/cabinet-finishes/data

200 OK
{
  "customTableId": "cabinet-finishes",
  "eTag": "content-version-7",
  "rows": [
    { "rowId": "finish-oak", "cells": [
      { "columnId": "finish-code", "value": "OAK-NATURAL" },
      { "columnId": "surcharge", "value": "12.5" }
    ] }
  ]
}

# 5. Send all rows back with the ETag
PUT /api/orderManager/configurationDataManagement/libraries/Production%20library/customTables/cabinet-finishes/data
Content-Type: application/json

{
  "eTag": "content-version-7",
  "rows": [
    { "rowId": "finish-oak", "cells": [
      { "columnId": "finish-code", "value": "OAK-NATURAL" },
      { "columnId": "surcharge", "value": "15.0" }
    ] }
  ]
}

200 OK
{ "succeeded": true, "message": "Replaced", "invalidRows": [] }

Warning: Writing to a table replaces its complete contents. Rows not included in the request are deleted, and rows: [] clears the table. Cell values are strings or null, including for numbers and Boolean values.

Results and Errors

Response Meaning
200 with succeeded: true The contents were replaced.
200 with succeeded: false Nothing changed. message and invalidRows (with rowId, columnId, value, isValid, message) explain why.
404 The library or table does not exist.
409 / 412 The table has changed since it was read. Read it again and reapply your changes.
422 The request could not be processed.

Failed writes are not retried automatically. Resolve the cause before sending another replacement.

Option: Synchronize with materialManager

A custom table linked to materialManager—for example, one containing boards, edges, textures, or hardware—is updated through synchronization. It runs asynchronously: keep the correlationId and check the status until it is Succeeded, Error, or Aborted. If synchronization cannot be started, for example because the table is not linked, the start call returns the Error status, the reason in errorTexts, and an empty correlationId.

var start = await cdm.StartCustomTableSync("Production library", "cabinet-finishes");

if (start.State == CustomTableSyncState.Error || string.IsNullOrEmpty(start.CorrelationId))
{
    throw new InvalidOperationException(string.Join(Environment.NewLine, start.ErrorTexts));
}

CustomTableSyncStateData? state;
do
{
    await Task.Delay(TimeSpan.FromSeconds(2));
    state = await cdm.GetCustomTableSyncState("Production library", "cabinet-finishes", start.CorrelationId);
}
while (state?.State is CustomTableSyncState.Queued or CustomTableSyncState.Started);
POST /api/orderManager/configurationDataManagement/libraries/Production%20library/customTables/cabinet-finishes/sync

200 OK
{
  "state": "Queued",
  "correlationId": "6f1c2d3e-4b5a-4c6d-8e9f-0a1b2c3d4e5f",
  "dataSource": "Default",
  "progress": 0,
  "errorTexts": [],
  "warningTexts": []
}

GET /api/orderManager/configurationDataManagement/libraries/Production%20library/customTables/cabinet-finishes/sync/6f1c2d3e-4b5a-4c6d-8e9f-0a1b2c3d4e5f

Synchronization statuses are Unknown, Queued, Started, Succeeded, Error, and Aborted. progress ranges from 0 to 100.

Integration Architecture

Update tables from the system of record's backend after its data changes. Always read before writing so that the replacement uses the current contents and the eTag protects against concurrent changes. Start a materialManager synchronization after material data changes. These operations require the OrderManager and HOMAG Connect orderManager licenses as well as the OrderManager permission for the authorization key; see Authentication.

Benefits

  • Configurators always use up-to-date values.
  • Material data from materialManager is reused instead of maintained twice.
  • Concurrent changes are detected instead of overwritten.

API reference: See Endpoints → HOMAG Connect orderManager → Configuration Data Management in the API reference. More examples are available on GitHub.