Ulf Kroehne
Paris, 2022/11/07 - 2022/11/08
Contrast
Links:
Components support Link Page
that can be used to define Regular Links and Conditional Links.
Events:
Components support Link ... Event
that can be used to trigger FSM Events.
Another Approach to Change Pages:
The CBA ItemBuilder supports Timed Event that trigger automatically after a given amount of seconds.
Definition:
Application
Examples
By default, timed events fire only once:
However, remember Self-Transition (StateA => StateA {Event}
) versus Internal Transitions (StateA internal {Event}
):
StateA => StateA {Event}
is necessary.Illustration for =>
vs. internal
:
The CBA ItemBuilder provides a simple Timer component that can be used to visualize time on pages.
Two modes:
Link Timed Event
Configuration
Repeated Timer (Self-Transition)
The CBA ItemBuilders Timer component has a limited set of properties. To show the remaining time using VariableValueDisplays
, the seconds can also be counted in the Finite-State Machine.
The CBA ItemBuilder allows defining of multiple tasks within one project file. The underlying idea is that content should not be designed and duplicated several times in different files.
The Task-editor also contains a button Open
, that opens an editor for the Task Initialization syntax.
Why? To configure Finite-State Machine settings (since the Finite-State Machine is shared across Tasks).
setFSMEvent()
is used to define task-specific time for the Timed Event.Most often, FSM-events are either linked to user interactions (by linking vents to components) or events are triggered automatically (timed-events).
Events can also be triggered in syntax (either in Conditional Links or in Finite-State Machine rules).
Trigger Event in FSM-Transitions:
raise(EventName)
Trigger Events in Conditional Links:
initFSM(EventName)
raise()
-operator can be used to structure FSM-Syntax and to avoid identical syntax in multiple transitions.With one finite-state machine (FSM), one reaches limits when: a) Timed events are used, b) States are used for navigation, or c) the items become complex. The CBA ItemBuilder allows using several FSMs.
Implemented by
Nesting Finite-State Machines1
Use of multiple machines with Regions2
When creating multiple nested FSM’s, take care that states of one machine are on the same level.
Combination of Timers with Regions for Full Flexibility
Option A: Two timed events within one state (self-transition)
Option B: Two timed events within one state (internal)
Option C: Two timed events within Regions (internal)
Within the Task Initialization Syntax and as operators in Conditional Links the time assigned to events and the page link to states can be changed.
setFSM()
-operator can be used to change, for instance, Timed EventsTimed Events in FSMs:
Are defined by a simple number after the event name in the State Machine Rules syntax (e.g., Events: EV_t1 2.5,
EV_t2 3600;
).
Time is defined in seconds (i.e., EV_t1
is triggered aft 2.5 seconds, EV_t2
after 120 minutes).
Timed events are (re-)started on each State-entry.
ST_A internal {EV_A /* | ... */}
will process event EV_A
without re-starting the timers.ST_A => ST_A {EV_A /* | ... */}
will process event EV_A
re-starting the timers!Regions (i.e, nested Finite-State Machines) can be used to disentangle states (i.e., to create dedicated states, for instance, for Task-level time limits).
Components of type Timer
(can be added to pages in the Page Editor) can show the remaining time (unit a Timed Event will trigger again).
Helpful to remember