oofp / beseder-demo-apps

Collection of Beseder applications and application specific resource definitions
3 stars 0 forks source link

beseder-demo-apps

ATM control program

This demo implements control of simplified ATM. ATM consists of four resources:

Supported operations:

Currently there are two alternative implementations of the program:

The demo are using Beseder feature of deriving resource declaration from type class that describe resource behavior. As a bonus, it also creates state diagram that provides visual presentation of resource behavior.

Here are state diagram for CashDispenser and Terminal resources:

Cash Dispenser Resource

ATM Terminal Resource

ATM Program example

State diagram of ATM program implemented as event loop.

AtmLoopApp.hs

This implementation is similar to traditional loop with state defined as ADT. Just that with Beseder state variants are inferred. All possible resource state combinations are shown and state transitions are shown below:

ATM program implemented as event loop

State diagram of of ATM program implemented as steps sequence.

AtmApp.hs

ATM State Diagram

Callback demo

This demo shows web controlled setup of callback call.

Outbound call resource state diagram

outbound_call

Callback resource state diagram

callback


Callback application with timers for call setup and call duration