Skip to content

12 Native v2 BlockModels ​

The @latticedx/plugin-dxos-blocks plugin implements 12 declarative Dxos*BlockModel classes built on NocoBase 2.2.50 FlowEngine v2 (@nocobase/client-v2). All 12 models are registered on the client via registerDxosBlockModels(client, React, antd, clientV2, flowEngine, app) (src/client/block-models.js) and allowlisted on the server in ALLOWED_DXOS_BLOCK_USES (portal-composer.js) and ALLOWED_FLOW_MODEL_USES (solution-bundle.js).

Every block queries tenant-scoped data (organizationId), inheriting application ACL rules and PostgreSQL 16 FORCE ROW LEVEL SECURITY enforcement.

Shared Architecture: dxosBlockSettings, Grid Placement, and 8 Foundation Blocks ​

All 12 Dxos*BlockModel classes extend BaseBlockModel (clientV2?.BlockModel || flowEngine?.getModelClass?.('BlockModel')) and share three core runtime mechanisms:

MechanismSymbol / HookRuntime Behavior
Settings flowdxosBlockSettings (on: 'beforeRender')Opens a scrollable config dialog (uiMode: { type: 'dialog' }, top: 24px, maxHeight: '78vh'). Saving invokes ctx.model.setProps(params) and notifyModelListeners(ctx.model).
Config precedencereadModelConfig(model, defaults, liveConfig)Merges `{ ...defaults, ...(model?.props
Grid placementFlowEngine Grid (PortalPageModel / RootPageModel)Supports side-by-side multi-column gridSettings via placeBesideOrInsertBlock.
Dynamic metadatadxosBlocks:collectionsMetaFetches user-accessible business and latticeCustom* collections while filtering 70+ internal tables (META_EXCLUDED_COLLECTIONS) and sensitive columns (password, secret, token, apiKey, privateKey, hash, salt, embedding, searchVector).

Distinction from the 8 Foundation Context BlockModels

Separate from the 12 DX-OS Native v2 Dxos*BlockModel classes, @latticedx/plugin-lattice-foundation (src/client/index.js) registers 8 foundation context BlockModels bound via the latticeBinding flow (latticeApps:list): LatticeFormBlockModel, LatticeListBlockModel, LatticeTaskInboxBlockModel, LatticeApprovalBlockModel, LatticeAttachmentBlockModel, LatticeActivityTimelineBlockModel, LatticeContextEntityBlockModel, and LatticeWorkflowFormBlockModel.

Catalog of All 12 Dxos*BlockModel Classes ​

#Class NameUI LabelPrimary Data Bindings / API Calls
1DxosPortalHeroBlockModelDX-OS Portal Hero & Quick ActionsClient navigation via filterHeroActions & isSafeAppPath
2DxosKpiMetricBlockModelDX-OS KPI Metric GridGET ${m.collection}:list (pageSize: 1, reads meta.count)
3DxosContextTelemetryBlockModelDX-OS NGSI-LD Context & TelemetryPOST dxosBlocks:contextTelemetry
4DxosAiProposalBlockModelDX-OS AI Proposal & EvidencePOST dxosBlocks:proposals, POST dxosBlocks:decideProposal
5DxosWorkflowTasksBlockModelDX-OS Workflow & My TasksGET workflowManualTasks:list, POST workflowManualTasks:submit
6DxosParaVaultBlockModelDX-OS P.A.R.A. Knowledge VaultlatticeParaDocuments:list, latticeParaDocuments:create
7DxosCreativeStudioBlockModelDX-OS Creative Studio Micro-AppDeclarative query runner (collection, telemetry, tasks, timeseries)
8DxosRecordWorkbenchBlockModelDX-OS Chatter, Chứng từ & Xuất báo cáolatticeChatter:list/post, dxosBlocks:exportReport, dxosWms:printVoucher
9DxosWebGisBlockModelDX-OS Bản đồ Giám sát WebGIS [D]dxosBlocks:twinShadow, dxosBlocks:twinSetDesired
10DxosKanbanScheduleBlockModelDX-OS Bảng Kanban & Lịch [H]${collection}:list / :update
11DxosWmsOpsBlockModelDX-OS Vận hành Kho FEFO & Bulk Import [W]dxosWms:*, dxosBlocks:bulkImportDryRun, dxosBlocks:bulkImportCommit
12DxosBiChartBlockModelDX-OS Biểu đồ & Phân tích BI [D]POST dxosBlocks:aggregateQuery

BlockModel Reference ​

1. DxosPortalHeroBlockModel ​

Renders the portal header banner with a context badge, hex accent color, and role-filtered quick-action buttons. filterHeroActions(actionsJson, perms) strips any action failing isSafeAppPath (blocking javascript:, external origins, or studio paths for operational roles).

DxosPortalHeroBlockModel Props
ParameterTypeDefaultDescription
title
stringKhông gian Điều hành Doanh nghiệp DX-OSPrimary hero heading.
subtitle
stringNền mở NocoBase 2.2.50 cho H–P–D–ISecondary description displayed beneath the title.
badge
stringDX-OSShort context pill rendered next to the heading.
accentColor
string#1677ffHex accent color applied to the banner trim and primary CTA.
actionsJson
string (JSON)DEFAULT_HERO_ACTIONSJSON array of [{ label, path, primary? }] button definitions.

2. DxosKpiMetricBlockModel ​

Renders a responsive 1–4 column KPI grid (columns clamped to 1..4). Each card defined in metricsJson executes GET ${m.collection}:list (pageSize: 1) to display meta.count and navigates to targetPath on click.

DxosKpiMetricBlockModel Props
ParameterTypeDefaultDescription
title
stringChỉ số vận hànhSection heading for the KPI grid.
columns
number4Grid column count, clamped to 1..4.
metricsJson
string (JSON)DEFAULT_KPI_METRICSJSON array of [{ label, collection, filter?, color, targetPath }] metric cards.

3. DxosContextTelemetryBlockModel ​

Queries POST dxosBlocks:contextTelemetry to display FIWARE Orion-LD NGSI-LD entity context, live sensor readings, and latticeContextOutbox delivery status. Numeric attributes exceeding warningThreshold are highlighted.

DxosContextTelemetryBlockModel Props
ParameterTypeDefaultDescription
title
stringNgữ cảnh NGSI-LD & Cảm biếnBlock header title.
assetEntityId
string''Asset code or NGSI-LD URN; leaves auto-selection active when empty.
warningThreshold
string80Numeric threshold used to flag elevated readings.
showSyncStatus
booleantrueDisplays pending and synced outbox counts.

4. DxosAiProposalBlockModel ​

Displays AI-generated operational proposals via POST dxosBlocks:proposals and submits human decisions (approve, review, reject) through POST dxosBlocks:decideProposal. Self-approval is blocked (SELF_APPROVAL_FORBIDDEN).

DxosAiProposalBlockModel Props
ParameterTypeDefaultDescription
title
stringĐề xuất AI & Bằng chứngBlock header title.
targetCollection
enumlatticeIncidentCasesAllowlisted collection: latticeIncidentCases, latticeAssets, latticeRequests, latticeOrders, or latticeServiceTickets.
state
all | proposed | reviewedallProposal lifecycle filter.
pageSize
number5Maximum rows per page.
showEvidence
booleantrueRenders supporting evidence snippets on each proposal card.

5. DxosWorkflowTasksBlockModel ​

Lists manual human tasks assigned to the authenticated user via GET workflowManualTasks:list and submits completions through POST workflowManualTasks:submit.

DxosWorkflowTasksBlockModel Props
ParameterTypeDefaultDescription
title
stringHộp việc Quy trình Poka-yokeTask inbox title.
statusFilter
pending | resolved | allpendingTask status filter.
pageSize
number6Maximum tasks displayed per page.

6. DxosParaVaultBlockModel ​

Browses and creates P.A.R.A. knowledge records (latticeParaDocuments:list and :create). Reads ?paraDocId= from the browser query string to deep-link directly to a specific document.

DxosParaVaultBlockModel Props
ParameterTypeDefaultDescription
title
stringKho tri thức P.A.R.A.Vault block heading.
paraSpace
all | projects | areas | resources | archivesallDefault P.A.R.A. space filter.
pageSize
number6Documents per page (1..25).
enableQuickCreate
booleantrueEnables inline Markdown document creation.
defaultOrganizationId
string''Default organization ID override for root administrators.

7. DxosCreativeStudioBlockModel ​

Renders a declarative micro-app cockpit from blueprintJson (defaulting to DEFAULT_CREATIVE_BLUEPRINT) with zero eval() or new Function(). The parseCreativeBlueprint parser (creative-studio-block.js) caps blueprints at 6 queries, 12 widgets, and 1..4 grid columns.

DxosCreativeStudioBlockModel Props
ParameterTypeDefaultDescription
title
stringBuồng Điều hành Thông minhOuter block title.
blueprintJson
string (JSON)DEFAULT_CREATIVE_BLUEPRINTDeclarative DSL JSON containing title, subtitle, theme, columns, queries, and widgets.

CreativeStudio Capabilities: 4 Query Kinds, 11 Widget Types, and 5 Themes ​

DSL GroupConstantSupported Values
Query kinds (4)VALID_QUERY_KINDScollection (max limit: 50), telemetry, tasks, timeseries (max limit: 200).
Widget types (11)VALID_WIDGET_TYPESgauge, thermometer, timeseries-line, stage-pipeline, distribution-bars, rule-callout, status-matrix, quick-actions (up to 6 navigate / createRecord / askAi buttons), export-bar, chatter, voucher-actions.
Built-in themes (5)CREATIVE_THEMESindustrial-cockpit, emerald-ops, amber-alert, royal-indigo, clean-light.
json
{
  "title": "Cold Room A Cockpit",
  "subtitle": "Live stock lot distribution and temperature telemetry.",
  "theme": "emerald-ops",
  "columns": 2,
  "queries": [
    { "id": "lots", "kind": "collection", "collection": "latticeStockLots", "limit": 30 },
    { "id": "tempSeries", "kind": "timeseries", "assetEntityId": "urn:ngsi-ld:Asset:org1:native:1", "attribute": "temperature", "limit": 100 }
  ],
  "widgets": [
    { "type": "gauge", "title": "Active Stock Lots", "queryId": "lots", "metric": "count", "max": 50, "unit": "lots" },
    { "type": "thermometer", "title": "Latest Probe Temp", "queryId": "tempSeries", "metric": "latest", "field": "value", "unit": "C" },
    { "type": "distribution-bars", "title": "Lot Status Mix", "queryId": "lots", "field": "status" },
    { "type": "quick-actions", "title": "Operations", "buttons": [{ "label": "Open FEFO Console", "kind": "navigate", "targetPath": "/p/logistics", "primary": true }] }
  ]
}

8. DxosRecordWorkbenchBlockModel ​

Combines voucher lifecycle controls, latticeChatter:list/post comments, Ed25519 PKI verification badges, latticeDataLineage inspection, QR voucher printing (dxosWms:printVoucher), and governed CSV/XLSX/PDF export (dxosBlocks:exportReport). WORKBENCH_COLLECTION_ENUM includes latticeRequests, latticeOrders, latticeServiceTickets, latticeAssets, latticeIncidentCases, latticeParaDocuments, and dynamic latticeCustom* collections.

DxosRecordWorkbenchBlockModel Props
ParameterTypeDefaultDescription
title
stringTrao đổi Chatter, Chứng từ & Xuất báo cáoWorkbench panel heading.
collection
stringlatticeRequestsTarget business or latticeCustom* collection.
recordId
string''Optional pinned record ID.
showExport
booleantrueDisplays governed CSV/XLSX/PDF export controls.
showVoucherActions
booleantrueDisplays voucher submit, approve, reject, and cancel actions.
showChatter
booleantrueDisplays record-scoped collaboration chatter.
showPkiBadge
booleantrueDisplays Ed25519 PKI ledger verification badge.
showLineage
booleantrueDisplays upstream/downstream data lineage drawer.
showPrintVoucher
booleantrueDisplays QR-verified voucher print button.

9. DxosWebGisBlockModel ​

Renders an interactive geographic map powered by maplibre-gl with a Vietnam SVG fallback (lat 8.0..23.8, lng 102.0..110.2, default hubs HUB-CT, HUB-HCM, HUB-DN, HUB-HN). When showTwinOverlay is enabled, it queries dxosBlocks:twinShadow and dispatches setpoints via dxosBlocks:twinSetDesired. Temperature changes exceeding HITL_DELTA_THRESHOLD_C = 2.0 °C pause in pending_hitl until approved.

DxosWebGisBlockModel Props
ParameterTypeDefaultDescription
title
stringBản đồ Giám sát Chuỗi lạnh WebGISMap header title.
defaultOrganizationId
string''Optional organization ID for admin scoping.
centerLat
number15.8Initial map center latitude.
centerLng
number106.5Initial map center longitude.
showTwinOverlay
booleantrueEnables Digital Twin shadow overlay and setpoint controls.
collection
string''Optional custom collection providing map coordinates.
latField
string''Optional latitude field name.
lngField
string''Optional longitude field name.
labelField
string''Optional marker label field name.
statusField
string''Optional status field name for marker coloring.

10. DxosKanbanScheduleBlockModel ​

Switches between a stage-grouped Kanban board (kanban) and a weekly calendar view (schedule). Voucher collections follow KANBAN_STAGE_ORDER (draft, submitted, approved, in_progress, completed, cancelled), while latticeStockLots follows STOCK_LOT_STAGE_ORDER (available, reserved, hold_mkt, expired). KANBAN_COLLECTION_ENUM covers latticeOrders, latticeRequests, latticeServiceTickets, latticeStockLots, and latticeCustom*.

DxosKanbanScheduleBlockModel Props
ParameterTypeDefaultDescription
title
stringBảng Kanban & Lịch vận hànhBoard heading.
collection
stringlatticeOrdersSource collection for cards and schedule entries.
viewMode
kanban | schedulekanbanDefault layout mode.
pageSize
number40Maximum records fetched per view.
statusField
string''Optional Kanban stage field override.
dateField
string''Optional date field used in schedule mode.
titleField
string''Optional card title field override.

11. DxosWmsOpsBlockModel ​

Provides a two-tab cold-chain warehouse console: FEFO lot allocation, stock issue, MKT hold, and QA release (dxosWms:*), plus a two-phase bulk import wizard (dxosBlocks:bulkImportDryRun and dxosBlocks:bulkImportCommit). Input CSV/JSON payloads are capped at MAX_BULK_IMPORT_BYTES = 2MB across the four IMPORT_COLLECTIONS: latticeStockLots, latticeAssets, latticeOrders, and latticeRequests.

DxosWmsOpsBlockModel Props
ParameterTypeDefaultDescription
title
stringVận hành Kho FEFO & Nhập lô hàng loạtWMS console title.
defaultOrganizationId
string''Default organization ID override for admin callers.
defaultTab
fefo | importfefoInitial active tab.
defaultImportCollection
enumlatticeStockLotsTarget collection: latticeStockLots, latticeAssets, latticeOrders, or latticeRequests.
showBulkImport
booleantrueToggles visibility of the 2-phase bulk import tab.

12. DxosBiChartBlockModel ​

Executes server-side aggregations via POST dxosBlocks:aggregateQuery with x-reactions dynamic field pickers across BI_COLLECTION_ENUM (12 core collections) and latticeCustom* tables.

To prevent unsafe query operator injection in filterJson, sanitizeClientFilterNode (bi-chart-block.js) enforces a maximum nesting depth of 10, blocks prototype keys (__proto__, constructor, prototype), rejects dotted field paths, and rejects all 6 keys in DANGEROUS_FILTER_KEYS:

text
$where, $raw, $sql, $eval, $function, $expr
DxosBiChartBlockModel Props
ParameterTypeDefaultDescription
title
stringPhân tích & Biểu đồ BIChart heading.
collection
stringlatticeOrdersSource collection for aggregation.
chartType
bar | line | pie | kpi | pivotbarChart visualization type.
groupBy
stringstatusPrimary grouping field.
secondaryGroupBy
string''Secondary column grouping field for pivot mode.
metricOp
count | sum | avg | min | maxcountAggregation function.
metricField
string''Numeric field used by sum, avg, min, and max.
limit
number20Maximum groups returned (1..500).
filterJson
string (JSON)''Optional filter object; rejects any key in DANGEROUS_FILTER_KEYS.

dxosBlocks Server Resource and dxosTelemetryDirectGuard ​

All block server operations route through 17 actions on dxosBlocks (blocks-api.js): 15 loggedIn actions (proposals, decideProposal, contextTelemetry, telemetrySeries, alarmIngest, alarmAck, alarmClear, exportReport, globalSearch, twinShadow, twinSetDesired, bulkImportDryRun, bulkImportCommit, collectionsMeta, aggregateQuery) and 2 public fail-closed edge actions (telemetryIngest, twinAckCommand, requiring either X-Lattice-Edge-Token of at least 16 characters matched in constant time against DX_IIOT_INGEST_TOKEN or a valid ACL-authorized user JWT).

The dxosTelemetryDirectGuard middleware blocks direct non-root CRUD or charts:queryData requests against latticeTelemetryPoints, latticeTwinShadows, latticeIotDevices, and latticeBrokerSubscriptions (403), forcing callers through dxosBlocks and dxosBroker.

Apache-2.0 · LatticeDX v0.4.2 · Powered by NocoBase · v2.2.50 · Apache-2.0 (Clause 5.2)