Zapišite pravila. Orb zgradi aplikacijo ali pove, zakaj je ne more.
curl -fsSL https://orb.almadar.io/install.sh | shCheckout
on Order · states: 3 · transitions: 3orb isti .lolo prevede v vsakega od teh.
Iz pending ni prehoda SHIP.
Checkout
on Order · states: 3 · transitions: 41aplikacija std-orb-sample-checkout "1.0.0"
2"std-orb-sample-checkout — the checkout program shown on orb.almadar.io's home page, running: an order that cannot ship before it is paid. The page shows this file as code beside the running trait, and each move is reported (MOVED) so its state machine can follow along."
3orbitala Orders {
4 entiteta Order [izvajanje] {
5 id : niz!
6 total : stevilo
7 }
8
9 znacilnost Checkout -> Order [interakcija, primerek] {
10 zacetno: pending
11
12 stanje pending {
13 ZACETEK -> pending
14 (izrisi-vmesnik main { type: stack, gap: sm, children: [
15 { type: typography, content: "Unpaid", variant: h4 },
16 { type: button, label: "Pay 40", action: PAY, actionPayload: { amount: 40 } }
17 ] })
18 PAY -> paid ko (> ?amount 0)
19 (nastavi @entiteta.total ?amount)
20 (oddaj MOVED { event: "PAY" })
21 (izrisi-vmesnik main { type: stack, gap: sm, children: [
22 { type: typography, content: "Paid 40", variant: h4 },
23 { type: button, label: "Ship", action: SHIP }
24 ] })
25 }
26
27 stanje paid {
28 SHIP -> shipped
29 (oddaj MOVED { event: "SHIP" })
30 (izrisi-vmesnik main { type: stack, gap: sm, children: [
31 { type: typography, content: "Shipped", variant: h4 },
32 { type: button, label: "New order", action: NEW_ORDER }
33 ] })
34 }
35
36 stanje shipped {
37 NEW_ORDER -> pending
38 (oddaj MOVED { event: "NEW_ORDER" })
39 (izrisi-vmesnik main { type: stack, gap: sm, children: [
40 { type: typography, content: "Unpaid", variant: h4 },
41 { type: button, label: "Pay 40", action: PAY, actionPayload: { amount: 40 } }
42 ] })
43 }
44
45 oddaja {
46 PAY {
47 amount : stevilo!
48 }
49 MOVED -> external {
50 event : niz!
51 }
52 @opis "Each move names the event it took, so a diagram beside the order can follow it."
53 }
54 }
55
56 stran "/checkout" -> Checkout
57}Vsak je ena datoteka .lolo.
Planets orbit a central mass under inverse-square gravity.
ready — press Step to advance the orbits
Logic gates combine inputs into outputs that follow their truth table.
Circuit 1 — (A AND B) XOR (A OR B)
Balls bounce off pegs and pile into a bell-shaped histogram.
Press Step to drop a batch of balls, or Run to auto-drop.
orb validate vas ustavi s kodo in vrstico.
$ orb validate checkout.lolo
❌ [ORB_BINDING_PAYLOAD_FIELD_UNDECLARED] orbitals[0 (Orders)].traits[0 (Checkout)].stateMachine.transitions[1].guard[1]: Event 'PAY' uses @payload.amount (.lolo spelling: `?amount` or `@payload.amount`) but has no payload schema defined @ 16:27
💡 declare the field in the event's `emits` payload block: `PAY -> external { amount : <type> }`
❌ [CIRCUIT_DEAD_END_STATE] orbitals[0 (Orders)].traits[0 (Checkout)].stateMachine.states: State 'shipped' has no outgoing transitions - it may be a dead end @ 10:3
💡 Add outgoing transitions or mark as terminal state with isTerminal: true
Error: Schema validation failed with 2 error(s)jezikov, v katere prevaja
vedenj v standardni knjižnici
jeziki ključnih besed
opozoril, ki jih dovoli orb validate
Namestite z eno vrstico. Prvi program zaženite v peskovniku.