Execute multiple design operations atomically with bindings and rollback.
Parses a JSON-based DSL of operations (Insert, Copy, Update, Replace, Move, Delete) and executes them sequentially against the scene ETS. If any operation fails, the entire batch is rolled back to the pre-execution snapshot.
Operations
| Op | Action | Required fields |
|---|---|---|
I | Insert | parent, data (type, component/tag) |
C | Copy | id, parent |
U | Update | id, data (attrs/slots/classes/layout) |
R | Replace | id, data (new node definition) |
M | Move | id, parent, optional index |
D | Delete | id |
Bindings
Operations with "bind" store the created/resulting node ID.
Subsequent operations can reference "$binding_name" in id or parent fields.
Limits
Maximum 25 operations per batch (matching OpenPencil convention).
Summary
Functions
Execute a batch of operations against the scene.
Functions
@spec execute(reference(), [map()], map()) :: {:ok, [map()], map()} | {:error, String.t(), integer()}
Execute a batch of operations against the scene.
Returns {:ok, results, bindings} on success or {:error, message, op_index} on failure.
On failure, the scene is rolled back to its pre-execution state.