Omni

If Traditional ECC is Stateful, and Intelligent - LWC is Stateless, and Dumb - Omni is Stateless, and Intelligent

That is a perfect architectural summary. You’ve categorized them by where the "brain" lives and how they "remember" the user. Here is the breakdown of why those labels fit so well:

SAP ECC: Stateful & Intelligent

LWC: Stateless & "Dumb" (UI Layer)

OmniStudio: Stateless & Intelligent

The Comparison Matrix

System Memory (State) Intelligence (Logic) Payload Strategy
SAP ECC Server-side (Active Session) High (Deeply Integrated) Chatty (Many tiny binary pings)
LWC Client-side (Browser RAM) Low (UI Logic Only) Light (JSON for display only)
OmniStudio None (Request-based) High (Externalized Rules) Heavy (Big JSON "Brain Dumps")

The Evolution:

We moved from ECC (Great logic, poor scale) to LWC (Great scale, no logic) and finally to OmniStudio, which tries to give you ECC-level intelligence with LWC-level scalability. The "tax" you pay for this, as you noted, is the massive network payload required to keep the server "intelligent" without making it "stateful".


Then how was Omni engineered on top of LWC

It’s a masterclass in abstraction. Salesforce (Vlocity) didn't just build components; they built a metadata-driven engine that sits on top of the LWC framework. Think of it this way: A standard LWC is a hand-coded sports car. OmniStudio is a modular factory that snaps together pre-built parts to create the car.

Here is how it’s engineered:

Metadata vs. Hard Code

In a normal LWC, you write HTML and JavaScript. In OmniStudio, you use a Drag-and-Drop Designer.

The JSON "DataBus"

OmniStudio components are engineered to be "Data-Aware".

Decoupling the "How" from the "Where"

OmniStudio engineers "Stateless Intelligence" by splitting the work into three distinct LWC layers:

Why this is "Stateless" Engineering

In SAP ECC, the server has to keep a "Shadow Copy" of your screen to know what to do next. In OmniStudio, the LWC is engineered to be self-contained. Because the entire "State" (your 900 lines) is held in the JSON DataTree in your browser, the LWC can send that entire state to any server, anywhere, at any time. The server doesn't need to "know" you; it just needs to read the JSON you just handed it.

Summary: The Engineering Stack

  1. LWC Framework: The "Lower Level" (handling the DOM and Browser events).
  2. OmniUI Layouts: A "Middle Layer" that interprets JSON metadata into visual components.
  3. OS/IP Engine: The "Brain" that manages the massive JSON payload and coordinates with the server Business Rules Engine.

By engineering it this way, Salesforce allows you to build a system that is as Smart as SAP (complex rules) but as Scalable as Netflix (stateless web components).


Omni Classes Can be Extended

To extend OmniStudio, you don't "edit" their code; you inherit their engine. When you create a custom LWC to sit inside an OmniScript, you extend the OmniscriptBaseMixin. This gives your custom component "magical" access to the 900-line JSON data bus.

Here is the architectural pattern for extending the "Engine":

The JavaScript: Connecting to the "Brain"

By using the OmniscriptBaseMixin, your custom LWC automatically listens to the master JSON tree.

        import { LightningElement } from 'lwc';
        import { OmniscriptBaseMixin } from 'omnistudio/omniscriptBaseMixin';

        export default class CustomQuoteLine extends OmniscriptBaseMixin(LightningElement) {
        // This allows you to read from and write to the 900-line JSON
        handleUpdate() {
          const myData = { "LinePrice": 100.00 };
          // This "pumps" data back into the OmniScript JSON DataTree
          this.omniUpdateDataJson(myData); 
          // This tells the OmniScript engine to re-run any formulas or BRE logic that depend on this value
          this.omniApplyCallResp(myData);
        }
        }
  

The HTML: Staying "Light"

Your custom LWC only needs to render the specific UI you want. The OmniStudio Engine handles the "stepping" (Next/Previous buttons) and the global save logic.

          <‍template>
          <‍div class="custom-row">
            <‍!-- Accessing data directly from the JSON bus -->
            <‍p>Current Price: {omniJsonData.LinePrice}<‍/p>
            <‍button onclick={handleUpdate}>Apply Discount<‍/button>
          <‍/div>
          <‍/template>
  

Why this is Architecurally Significant:

The "Engine" Advantage

This is how Salesforce handles the "Stateless, Intelligent" requirement. You can build a highly "Dumb" UI component, but as soon as you wrap it in the OmniscriptBaseMixin, it becomes "Intelligent" by tapping into the server-side Integration Procedures and BRE that OmniStudio orchestrates.


Omni is Not a Bunch of Custom Made LWC Components - This is a Big Misconception!

Correct. You've nailed the common misunderstanding. OmniStudio is a metadata-driven runtime engine that generates or controls LWCs dynamically, rather than just being a toolbox of fixed components.

Here is how that "Engine" actually works under the hood:

It’s a "Code Generator" (Managed Package Runtime)

In the traditional Managed Package Runtime, when you click "Activate" on an OmniScript, OmniStudio actually compiles and deploys a brand-new LWC bundle to your Salesforce org.

The "Standard Runtime" Evolution

Salesforce is moving toward a Standard Runtime where LWC generation is replaced by a high-performance interpreter.

The "Stateful" JSON Proxy

Standard LWCs are usually isolated, but OmniStudio LWCs are engineered with a shared JSON Data Bus.

"Extensibility" Over "Customization"

Because it's an engine, you don't "edit" the OmniStudio code. You extend it.

Summary: You aren't just dragging boxes; you are programming a runtime engine via JSON metadata. The LWC part is just the "skin" that makes it visible in the browser.


Material for Omni Architecture (Not How to Use Omni Tools)

To understand the deep architectural layers of OmniStudio rather than just the "how-to," you should focus on resources that detail the stateless interaction model, metadata runtime, and JSON data bus.

Top Technical Architecture Resources

Conceptual Architecture Summary