Skip to content

Call Sequences

This page shows exactly when each method is called, in the context of user workflows. For each workflow, there is a sequence diagram followed by explanatory notes.


Opening a project file

sequenceDiagram
    participant HS as HydroSym
    participant P as Plugin

    Note over HS: User opens valve-assembly.hsc
    HS->>P: GetFileStatus({filePath})
    P-->>HS: {status: "checkedIn", version: 3, isManaged: true}

    alt Auto-checkout enabled in HydroSym settings
        HS->>P: CheckOut({filePath, projectId})
        P-->>HS: {lockedBy: "wouter", version: 3}
    end

    HS->>P: GetProjectVariables({projectPath, projectId})
    P-->>HS: {variables: {CustomerName: "Bosch Rexroth", Revision: "C", DrawingNo: "VA-2025-0042"}}

    Note over HS: Apply variables to title block
    Note over HS: Update menu states
    HS->>P: GetMenuItemState({menuItemIds, context})
    P-->>HS: {states: {acme-checkout: {enabled: false}, acme-checkin: {enabled: true}}}

What triggers it: User opens a .hsc file via File → Open or via a recent file.

What HydroSym does with the returned data: - GetFileStatus: Shows a status indicator (lock icon) in the title bar. Triggers auto-checkout if configured. - CheckOut: Stores the lock status; updates menu states. - GetProjectVariables: Populates the title block fields in the schematic.

Conditional steps: - GetFileStatus is only called if the plugin has getFileStatus capability. - CheckOut is only called if auto-checkout is enabled in HydroSym's settings and getFileStatus returned a managed file. - GetProjectVariables is only called if the plugin has getProjectVariables capability.

If the plugin returns ERROR: HydroSym shows the error message and continues opening the file (the step is skipped but the file opens).


Inserting a component

sequenceDiagram
    participant HS as HydroSym
    participant P as Plugin

    Note over HS: User inserts valve HV-301 from the library
    HS->>P: GetComponentParameters({articleCode: "HV-301", projectId: "PRJ-2025-0042"})
    P-->>HS: {articleCode: "HV-301", status: "released", price: 1250.00, manufacturer: "Bosch Rexroth", stock: 8}
    Note over HS: Show status badge in library panel
    Note over HS: Store price and parameters on the symbol

What triggers it: User drags a component from the library into the schematic, or configures an existing component.

What HydroSym does with the returned data: Displays status and price in the component properties panel. Stores all returned properties on the symbol for BOM generation.

If the plugin returns NOT_FOUND error: HydroSym shows a warning badge on the component ("not found in ERP") but still allows the insertion.


Before generating output (PDF, BOM export)

sequenceDiagram
    participant HS as HydroSym
    participant P as Plugin

    Note over HS: User clicks "Export PDF"
    HS->>P: GetProjectVariables({projectPath, projectId})
    P-->>HS: {variables: {CustomerName: "Bosch Rexroth", Revision: "C"}}
    Note over HS: Apply variables to title block

    loop For each component in the project
        HS->>P: GetComponentParameters({articleCode})
        P-->>HS: {status, price, ...}
    end

    Note over HS: Generate PDF with current title block and component data

What triggers it: User clicks any output action (Export PDF, Print, Generate BOM).

Why HydroSym re-fetches: To ensure the output reflects the latest ERP state, not stale cached data from when the file was opened.

Performance note: If your project has many unique components, GetComponentParameters will be called once per unique article code. Consider caching results in your plugin for the duration of a session to avoid redundant ERP queries.


User clicks a search menu item (resultType=component)

sequenceDiagram
    participant HS as HydroSym
    participant P as Plugin
    participant D as Plugin Dialog

    Note over HS: User clicks "Search Acme ERP..."
    HS->>P: OnMenuAction({menuItemId: "acme-search", parentWindowHandle: 131072, context})
    P->>D: Show WinForms search dialog (modal, parent=HydroSym window)
    Note over D: User searches for "directional valve", selects HV-301
    D-->>P: User confirmed selection
    P-->>HS: {articleCode: "HV-301", description: "Directional valve 4/3, 24V DC", manufacturer: "Bosch Rexroth"}
    Note over HS: resultType=component → insert/apply selected component to schematic

What triggers it: User clicks a menu item whose resultType is component.

Using parentWindowHandle: Pass parentWindowHandle to your dialog constructor so it is modal over HydroSym's window. Without this, the dialog can go behind HydroSym.

If the user cancels the dialog: Return an empty response {}. HydroSym takes no action.


Closing a project file

sequenceDiagram
    participant HS as HydroSym
    participant P as Plugin

    Note over HS: User closes project (or saves and closes)
    HS->>P: SetProjectVariables({projectPath, projectId, variables})
    P-->>HS: {} (OK)

    opt uploadBom capability and auto-upload enabled
        HS->>P: UploadBom({projectId, projectPath, format: "structured", items: [...]})
        P-->>HS: {bomId: "BOM-2025-1234"}
    end

    opt uploadDrawing capability and auto-upload enabled
        HS->>P: UploadDrawing({projectId, projectPath, files: [{format: "pdf", ...}]})
        P-->>HS: {documentIds: [...]}
    end

    opt checkIn capability and auto-checkin enabled
        HS->>P: CheckIn({filePath, projectId, comment: ""})
        P-->>HS: {newVersion: 4}
    end

What triggers it: User closes a project file (prompted to save first if there are changes).

What HydroSym does: Pushes the current title-block variables back to the ERP/PDM, then optionally uploads BOM and drawings, then checks in the file.

Order matters: HydroSym always calls in the order shown — variables first, then BOM, then drawing, then check-in. This ensures check-in happens only after all outputs are uploaded.

Conditional steps: Each step is controlled by HydroSym configuration settings. A minimal PDM integration might only implement SetProjectVariables and CheckIn.


Viewing manifold identifiers

sequenceDiagram
    participant HS as HydroSym
    participant P as Plugin

    Note over HS: User opens i-border properties or manifold export dialog
    HS->>P: GetManifoldIds({projectPath, borderId: "IB-001", borderName: "Assembly Sheet 1"})
    P-->>HS: {manifoldIds: [{id: "MNF-2025-A1", articleCode: "MB-001", description: "Manifold block A"}]}
    Note over HS: Display manifold IDs in the i-border properties panel

What triggers it: User views or edits i-border properties, or initiates a manifold-to-HydroMan export.

Use case: Link a manifold block drawn in HydroSym to its identifier in the ERP or PDM so that HydroMan exports can reference the correct item.