Skip to content

feat(process-instance): add businessId to process-instance views for v8.9+ #239

Description

@grafvonb

Parent

Part of #203

Summary

Add the first-class businessId field (introduced in Camunda 8.9) to all human and JSON views that display process instances. This covers the output rendered by commands such as get pi, walk pi, and any other command that renders process-instance rows or trees. Older version views (v8.6, v8.7, v8.8) must remain unchanged.

Scope

In scope

  • Add BusinessId field to the facade model (c8volt/process/model.go → ProcessInstance).
  • Add BusinessId field to the domain model (internal/domain/processinstance.go → ProcessInstance).
  • Map businessId from the v8.9 client response through the service → domain → facade conversion layers.
  • Display businessId in human (table/flat-row) views when present:
    • flatRowPIWithTimezone — add a bid:<value> tag (similar to p:<root>) when non-empty.
    • oneLinePIWithTimezone — inherits from flatRowPIWithTimezone.
    • renderFamilyTree / renderIncidentEnrichedFamilyTree / renderActivityFamilyTree — all delegate to oneLinePIWithTimezone, so they pick it up automatically.
  • Include businessId in JSON output via the existing json:"businessId,omitempty" tag on the facade model.
  • Ensure the field is only populated for v8.9 service responses; v8.6/v8.7/v8.8 services must not set it.

Out of scope (covered by other sub-issues of #203)

  • --bid selector flag and search-backed resolution.
  • Setting businessId on run pi.
  • Configuration switch (app.process_instance_business_id).
  • Version-gating errors when business ID features are used on older clusters.
  • README documentation updates.

Acceptance Criteria

  • ProcessInstance facade struct contains BusinessId string with json:"businessId,omitempty".
  • ProcessInstance domain struct contains BusinessId string.
  • v8.9 service maps the generated client's BusinessId into the domain model.
  • v8.6, v8.7, v8.8 services do not set BusinessId — existing output is unchanged.
  • get pi human output shows bid:<value> when BusinessId is non-empty.
  • walk pi tree output shows bid:<value> in each node line when BusinessId is non-empty.
  • get pi --json includes "businessId" in the JSON payload when present.
  • Existing tests pass; new unit tests cover the view rendering with and without businessId.

Implementation Hints

  • Follow the existing pattern for optional display tags (see pTag, eTag, vTag, incidentTag in flatRowPIWithTimezone).
  • Place the bid: tag after the key column and before the BPMN process ID for quick scanning, or after the parent tag — whichever reads better with existing output.
  • The v8.8 generated client already contains BusinessId but it is not yet an official Camunda 8.8 feature — only populate from v8.9 service layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions