Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Purchase approval swimlane

Make ownership changes and the revision path visible in one diagram instead of describing them only in prose.

Start with
Approval roles, process steps and labeled transitions
Generate
VSDX + SVG
Generated Visio example: Purchase approval swimlane
Generated diagram · Generated by the example below

How it works

  1. Define the grid

    Declare the requester, budget owner and operations lanes, then add intake, review, decision and fulfilment phases.

  2. Place the steps

    Use typed start, step, decision and end nodes with their lane and phase identifiers.

  3. Connect the outcomes

    Add the approval handoff and an explicit revision path back to review. Reopen the VSDX before rendering PNG and SVG.

The C# source

This is the complete example file used to generate the download. The walkthrough runner creates the output directory and produces the additional previews.

using OfficeIMO.Visio;
using OfficeIMO.Visio.Diagrams;

namespace OfficeIMO.Examples.Showcase.Workflows;

/// <summary>Maps a purchase approval across requester, budget owner and operations with an explicit revision path.</summary>
internal static class ApprovalSwimlane {
    internal static void Create(string folder) {
        var document = VisioDocument.Create(Path.Combine(folder, "example.vsdx"))
            .SwimlaneDiagram("Purchase approval", swim => swim
                .Theme(VisioStyleTheme.Modern())
                .Lane("requester", "Requester").Lane("owner", "Budget owner").Lane("operations", "Operations")
                .Phase("intake", "Intake").Phase("review", "Review").Phase("decision", "Decision").Phase("fulfil", "Fulfil")
                .Start("submit", "Submit request", "requester", "intake")
                .Step("check", "Check need", "owner", "review")
                .Decision("approve", "Approved?", "owner", "decision")
                .Step("revise", "Clarify request", "requester", "decision")
                .Step("order", "Place order", "operations", "decision")
                .End("receive", "Confirm receipt", "operations", "fulfil")
                .Flow("submit", "check", "request").Flow("check", "approve")
                .Exception("approve", "revise", "revise").Handoff("approve", "order", "yes")
                .Flow("revise", "check", "resubmit").Flow("order", "receive"));
        document.Save();
    }
}
Open the C# source file

Run it from the source checkout

Clone the OfficeIMO repository and run this command from its root with the .NET 10 SDK. The first run restores the example project's dependencies.

dotnet run --project OfficeIMO.Examples -f net10.0 -- --showcase-workflows --showcase-example visio-approval-swimlane

The files are written to OfficeIMO.Examples/bin/Debug/net10.0/Documents/Workflows/visio-approval-swimlane/. To use the example in your application, start with the Visio guide and its package setup.

Downloads and scope

What the preview shows

The linked C# example generates this file. The runner reloads the VSDX, checks the authoring model and renders the saved diagram to PNG and SVG.

What to keep in mind

The VSDX is validated and rendered by OfficeIMO. The preview does not demonstrate editing or routing behavior in desktop Visio.

Visio API reference · Artifact hashes and provenance

Continue with another example

Example source

Download source