This is a conceptual question about applying UML State Machine model for smart contracts in blockchain. I want to develop a smart contract framework in a bitcoin-like blockchain which is based on the state machine concept. It would allow to define state machine events, states and transitions as a smart contract configuration and execute it. So we would not need coding to implement many smart contract applications but just define an approriate state machine configuration.
I want to follow UML State Machine concepts as I believe it is well-defined and consistent. In short, UML State Machine supposes that there exist several kinds of events which trigger transitions from a state to state. If we try to apply UML StateMachine concepts on the blockchain ground we'll find that in blockchain most events would be transactions which spend or transfer coins from some addresses.
My problem is that the UML State Machine concepts are not sufficient for implementation of state machines in blockchain: UML allows to define a State Action so we could do something when a state machine transitions from a state to state. But I also need a state machine feature to prevent events to occur in the blockchain.
The simplest example is funds time locking. Let a StateMachine could be in two states: 'Coins Locked on Address' and 'Coins Unlocked on Address when Timeout Passed'.
So when it is in the first state I need to disable spending from that address where coins are locked. So I suppose this spending is a event which I need to either enable or disable, depending on the current state, but could not find in UML standard any support for event conditions.
The question is: Is there something in UML State Machine concepts that would allow for events to occur conditionally (when the StateMachine is in a pre-defined state).
Or maybe I'm wrong and I need to use another concept for this (that is, not the 'event' what I'm trying to use)?