
I built a state machine where invalid transitions can't compile
You know this bug. You're building an OAuth flow. Ten states. Five callbacks. A token refresh that fires at exactly the wrong moment. And then, three hours into debugging: "Wait — when we reach CALLBACK_RECEIVED , does authorizationCode definitely exist?" You grep. You trace. You add a null check. You deploy. Two weeks later, a different state, a different missing field, the same three hours. I got tired of this. So I built tramli . What tramli does in 30 seconds tramli is a constrained flow engine. You declare states, transitions, and — this is the key part — what data each processor needs and what it produces : enum OrderState implements FlowState { CREATED ( false , true ), PAYMENT_PENDING ( false , false ), CONFIRMED ( false , false ), SHIPPED ( true , false ); // ... } var flow = Tramli . define ( "order" , OrderState . class ) . initiallyAvailable ( OrderRequest . class ) . from ( CREATED ). auto ( PAYMENT_PENDING , new StartPayment ()) . from ( PAYMENT_PENDING ). external ( CONF
Continue reading on Dev.to
Opens in a new tab



