---
title: "O2C Demo: Demo Data and How the Script Generates It | Nodinite"
description: "How the Nodinite Order-to-Cash demo data is generated: the sample orders, customers, and products, the happy-path assumption, how the PowerShell script decides which steps each order completes, its timing, and the DryRun and ExportToFile options."
---

# :fa-terminal: O2C Demo: Data Generation

This page is part of the [Order-to-Cash demo][O2C Overview]. It describes the sample data and the strategy the PowerShell script follows to turn it into [Log Events][]. To run the script, follow [Generate O2C Demo Data][Generate-O2C-Demo-Data].

![PowerShell 7 exporting 10 orders to the file O2C-10.json, a loop posting the file's 126 Log Events, then the Log View Contoso: Orders searched Today with the new orders, the first row ORD-10010's last step in red with Log Status -1337, animated walkthrough (7.12)][1]  
*Animated walkthrough: generate 10 orders with `-ExportToFile`, post the exported events to the [Log API][] in a loop (the script itself never calls it), and search the **Contoso: Orders** [Log View][Log Views] with **Today**. The orders are dated from 06:00 UTC today, and the red row is the last Send event of an incomplete order, with Log Status `-1337`.*  

## :fa-database: Demo Data

The demo uses realistic, fictitious sample data:

* **Order IDs**: `ORD-10001` through `ORD-10100` (100 interchanges)
* **Customers**: six, in Springfield, Seattle, Stockholm, and Gothenburg; order 1 is always `CUST-001` *Contoso Corporation*
* **Products**: three SKUs, quantity 1 to 5, in `USD`

The tables, and how to group the orders by Country, City, ZIP, and Customer, are in [Generate O2C Demo Data][Generate-O2C-Demo-Data].

### Happy Path Assumption

Within one order, the data stays consistent across [Message Types][]:

* The customer, product, quantity, and total are the same in every step
* No error states or retry scenarios (all Log Statuses are `0` for success, except the last Send event of an incomplete order, which receives `-1337`)

## :fa-gears: Demo Execution Strategy

### Data Generation

A **PowerShell script** generates 100 order interchanges with:

1. **Deterministic Happy Path**: Each order starts at Step 0 (Order Received)
2. **Random Step Completion**: Not all orders complete all 7 steps
   * Probability of progressing to the next step: 90% per milestone
   * The first order always completes all 7 steps, and every other order completes at least 2 steps
   * This simulates realistic business scenarios where some orders get stuck or are cancelled
3. **Incremental Order Numbers**: Starting from `ORD-10001`, incrementing by 1
4. **Random DateTime Increments**: The first order starts at 06:00 UTC on the day you run the script, so a run before 06:00 UTC creates events dated later than now (search them with **Today**). Each step's Receive event comes 30-300 seconds after the previous event, its Send event 1-4 seconds later, and the next order starts 2-10 minutes after the previous one ends
5. **Incomplete Order Handling**: The last Send event of an incomplete order receives Log Status code `-1337` (custom error code for this demo); its Receive event keeps `0`
6. **Paired Events**: Each step generates 2 events (Receive + Send) for a complete audit trail
7. **SequenceNo**: Starts at 1 (not 0) for easier progress tracking, and ranges from 1-14 for complete orders

## :fa-terminal: PowerShell Data Generation Script

A PowerShell script automates the creation of 100 realistic orders:

* **Script**: [Generate O2C Demo Data Script][Generate-O2C-Demo-Data-Script]
* **Usage guide**: [Generate O2C Demo Data][Generate-O2C-Demo-Data]
* **Generates**: ~1,070 Log Events (100 orders × ~10.7 events average per order; every run differs)
  * Complete orders (all 7 steps): ~54 orders × 14 events = ~756 events
  * Partial orders (2-6 steps): ~46 orders × variable events = ~314 events
* **Features**:
  * Probabilistic step completion (90% progression rate)
  * Incremental order numbers (ORD-10001 through ORD-10100)
  * Random timestamp increments (30-300 seconds between steps, 1-4 seconds between a step's Receive and Send events)
  * Multi-format payloads (JSON, XML, CSV, PSV), to demonstrate the format-agnostic logging in :Nodinite:
  * Context Properties for business analytics
  * Varied customers and products, consistent within each order
  * Paired Receive→Send events for each milestone, including separate Log Events for the [forwarding Services][O2C Forwarder Services]
  * SequenceNo starts at 1 (not 0) for easier tracking

### Data Generation Options

* **DryRun mode**: Previews the first 14 Log Events, which is the first order (it always completes all 7 steps)
* **ExportToFile**: Saves to a JSON file (no API calls)
* **Posting**: The script never calls the Log API; post the exported file with the loop in [Post the Exported Events to the Log API][Post Exported Events]
* **PowerShell 7**: The script needs `pwsh`; Windows PowerShell 5.1 and PowerShell ISE can't run it
* **Randomness**: The script sets no random seed, so every run produces a different mix of complete and incomplete orders

## :fa-hand-point-right: Next Steps

* :fa-terminal: [Generate O2C Demo Data][Generate-O2C-Demo-Data] - Run the script  
* :fa-eye: [O2C Demo: Follow One Order][O2C Follow One Order] - See the result in :Nodinite:  
* :fa-file-code: [O2C Demo: Log Event Structure][O2C Log Event Structure] - What each generated event holds  

## :fa-link-horizontal: Related Topics

* :fa-house: [Order-to-Cash Demo Overview][O2C Overview]  
* :fa-code: [Generate O2C Demo Data Script][Generate-O2C-Demo-Data-Script]  
* :fa-diagram-project: [O2C Demo: Process Steps, Systems, and Services][O2C Process]  

[1]:{ndm}/Documentation%20Pictures/IM/WebClient/Repository/BPMs/O2C/O2C_GenerateSmallBatch.gif

[Generate-O2C-Demo-Data]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data.md
[Generate-O2C-Demo-Data-Script]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data-Script.md
[Log API]:{ndr}/Core%20Services/Log%20API/Overview.md
[Log Events]:{ndr}/Core%20Services/Log%20Event/Overview.md
[Log Views]:{ndr}/Administration/1.%20Log%20Management/1.%20Log%20Views/Features/What%20is%20a%20Log%20View.md
[Message Types]:{ndr}/Repository%20Model/Message%20Types/Overview.md
[O2C Follow One Order]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/O2C-Follow-One-Order.md
[O2C Forwarder Services]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/O2C-Process-and-Services.md#forwarder-services
[O2C Log Event Structure]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/O2C-Log-Event-Structure.md
[O2C Overview]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Overview.md
[O2C Process]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/O2C-Process-and-Services.md
[Post Exported Events]:{ndr}/Repository%20Model/BPMs/Examples/Order-to-Cash/Generate-O2C-Demo-Data.md#post-the-exported-events-to-the-log-api