What is VPasCode?

The GUI of Visual Paradigm VPasCode
VPasCode (Visual Paradigm as Code) is an agile diagramming environment designed for developers, software architects, and systems analysts who prefer text-based modeling over manual drag-and-drop drawing. By using declarative script syntax (such as PlantUML), VPasCode instantly renders clean, standardized software engineering diagrams as you type.

The core concept behind “Diagrams-as-Code” is maintaining visual architectural assets with the same speed, versionability, and precision as standard application code. VPasCode bridges textual definitions with visual representation, allowing you to model complex systems without worrying about manual layout positioning.

Understanding the Interface

When you open VPasCode, the screen is split into two primary panes:

  • Code Editor (Left Pane): Your active scripting workspace. Text syntax entered here is parsed continuously in real time.
  • Diagram Preview (Right Pane): The live canvas that dynamically renders the graphical model based on your script syntax.
  • Top Toolbar: Contains high-level AI tools, theme selectors, and layout settings.
  • Bottom Bar: Houses export options, platform integrations, and pipeline sending tools.

What Can You Achieve with VPasCode?

Evaluating VPasCode gives you a preview of how modern visual modeling accelerates software documentation across the engineering lifecycle:

  • Rapid Prototyping: Translate architectural ideas into standard UML, C4 models, or sequence flows within seconds without touching a mouse.
  • AI-Assisted Modeling: Leverage embedded generative AI to auto-create, expand, or translate complex diagrams from natural language prompts.
  • Hybrid Editing: Seamlessly transition from code-based generation to visual drag-and-drop editing using the VP Online ecosystem integration.
  • Pipeline Publishing: Push generated visual artifacts directly into documentation tools like OpenDocs without manual saving and re-uploading.

Creating a Diagram from Code – Basic Workflow

In this exercise, you will create a standard Use Case Diagram for the evaluation’s ongoing ATM System project. A Use Case Diagram maps out the system boundary, the actors (users or external systems), and the specific interactions offered by the ATM.

Step 1: Open VPasCode

You can access the VPasCode application through either of the following methods:

Step 2: Enter the Script Syntax

Replace any default sample text in the left-hand code editor by copying and pasting the following ATM Use Case definition:

@startuml
left to right direction
skinparam packageStyle rectangle

actor "Customer\n(Primary)" as customer
actor "Bank Administrator\n(Primary)" as admin
actor "Bank Server\n(Secondary)" as bank_server
actor "Cash Management System\n(Secondary)" as cash_mgmt

rectangle "ATM System" {
  usecase "Authenticate User" as uc_auth
  usecase "Change PIN" as uc_pin
  usecase "Check Balance" as uc_balance
  usecase "Transfer Funds" as uc_transfer
  usecase "Withdraw Cash" as uc_withdraw
  usecase "Deposit Cash" as uc_deposit
  usecase "View Transaction Log" as uc_view_log
  usecase "Update Software" as uc_update_sw
  usecase "Refill Cash Cassettes" as uc_refill
}

' Customer interactions
customer -- uc_auth
customer -- uc_pin
customer -- uc_balance
customer -- uc_transfer
customer -- uc_withdraw
customer -- uc_deposit

' Bank Administrator interactions
admin -- uc_view_log
admin -- uc_update_sw
admin -- uc_refill

' External system interactions
uc_auth -- bank_server
uc_balance -- bank_server
uc_transfer -- bank_server
uc_withdraw -- bank_server
uc_deposit -- bank_server
uc_refill -- cash_mgmt

@enduml

Rationale: Notice how defining relationships (e.g., customer -- uc_auth) automatically draws structured connectors on the right pane while maintaining logical grouping inside the ATM System boundary rectangle.

Step 3: Choosing a Theme

Styling diagrams manually can take valuable time. VPasCode provides built-in theme presets to apply uniform corporate styling instantly.

  1. Click the Theme drop-down menu located above the visual preview pane.
  2. Select visual-paradigm from the list. Observe how the diagram color palette and typography instantly adapt.

Step 4: Exporting a Diagram as an Image

  1. Locate and click the Export button on the bottom control bar.
  2. Select Export PNG. The rendered ATM Use Case Diagram will download directly to your local file system.

AI-Powered Operations

Generative AI in VPasCode extends beyond simple code generation; it acts as a software architecture co-pilot capable of structural analysis, language translation, and automated syntax expansion.

Modify an Existing Diagram with AI

Rather than manually typing out structural updates, you can instruct the AI agent to alter the logic directly.

  1. Click AI Tools in the top toolbar.
  2. Select Modify Diagram from the drop-down menu.

  3. In the prompt field, type: Add 3 more essential use cases into this diagram.
  4. Click AI Modify. The AI will study your existing code along with your request of modification, and then update your diagram code accordingly.

Translating Diagram Elements for Internationalization

Documentation often needs localized versions for distributed teams.

  1. Click AI Tools > Translate Diagram.

  2. Ensure the target language is set to Chinese (Simplified).

  3. Click Translate. The AI parses the structural labels (actors, use case names, system boundaries) and replaces them with translated terms while keeping the diagram syntax intact.

Generating New Diagrams from Natural Language

You can generate complete technical models from simple textual requirements without writing syntax from scratch.

  1. Click AI Tools > Generate Diagram.

  2. Enter the prompt: Generate a sequence diagram for the cash withdrawal process of an ATM System.

  3. Click AI Generate. VPasCode will generate a sequence diagram in PlantUML as per the diagram generation request.

Extended Workflows & Platform Integration

Code-based modeling excels at rapid structure creation, but precise cosmetic adjustments or deeper enterprise data modeling sometimes require direct graphical manipulation. VPasCode bridges this gap through two-way workspace integration.

Visual Editing via VP Online Drag-and-Drop Editor

To demonstrate hybrid editing, we will start with a Domain Class Model script and transition into visual editor mode.

  1. Paste the following domain class model script into the VPasCode editor:
    @startuml
    
    class Customer {
      - customerId: String
      - name: String
      - phoneNumber: String
    }
    
    class Account {
      - accountNumber: String
      - balance: Double
      - pin: String
      + validatePin(input: String): Boolean
      + updateBalance(amount: Double): void
    }
    
    class Transaction {
      - transactionId: String
      - date: Date
      - amount: Double
      + log(): void
    }
    
    class CashCassette {
      - denomination: Int
      - count: Int
      + dispense(amount: Int): Boolean
      + refill(amount: Int): void
    }
    
    class ATM {
      - terminalId: String
      - location: String
      + authenticateUser(card: String, pin: String): Boolean
      + dispenseCash(amount: Double): Boolean
    }
    
    ' Relationships
    Customer "1" -- "0..*" Account : owns
    Account "1" -- "0..*" Transaction : has
    ATM "1" *-- "1..*" CashCassette : contains
    
    @enduml

  2. Click Edit in VP Online at the bottom right corner.


    This transfers your model into the full visual editor canvas.

  3. Hover over the ATM class shape to reveal its 4 direction connectors (resource icons).

  4. Click and hold the bottom arrow icon, drag down onto an empty space on the canvas, and release the mouse.
  5. From the context popup menu, choose Association > Class.

  6. Name the new class BankServer.
  7. Right-click the BankServer shape, select Add Attribute, and type: - serverIp: String.

  8. Right-click BankServer, select Add Operation, and enter: + verifyCustomer(card: String, pin: String): Boolean.
  9. Add a second operation: + processTransaction(t: Transaction): Boolean.
  10. Adjust the connector line formatting to oblique routing for visual clarity.

  11. Select File > Save as from the top menu. Set the name to Domain Class Model, assign it under the project ATM System, and click Save.

Publishing Diagrams to Technical Documentation (OpenDocs Integration)

Centralized documentation requires seamless asset integration. Instead of exporting images and manually uploading them to document portals, VPasCode utilizes a shared central memory pipeline.

  1. In VPasCode, locate the bottom action bar and click Export > Send to Pipeline.

  2. Leave the optional name prompt as default and click Confirm. (The diagram is now stored in your active evaluation session memory).

  3. Open the OpenDocs application via one of two options:
    • Method 1: Select More Apps > OpenDocs from the application bar.

    • Method 2: Use the top application switcher in the Unified Platform to choose OpenDocs.
  4. The pre-configured sample space is opened: ATM System Architecture Hub.
  5. In the left sidebar navigation, select page 2.1 Domain Model.

  6. Scroll down to section “2. Domain Class Diagram” and place your cursor in the insertion area under the placeholder instructions.

  7. Click the Pipeline button at the top right header to open the platform data pipeline drawer.

  8. Click on the Class Diagram thumbnail you pushed earlier from VPasCode. The rendered diagram will instantly embed into the document.

  9. Click Save at the top right to commit your live documentation updates.

Scroll to Top