Sate Configuration
CGI Studio enables application logic through an integrated state machine model. State machines, combined with controls and behaviors, support the construction of complex application logic without programming.
This section describes how to set up transitions between scenes using state machines. The ultimate goal is to trigger scene transitions by clicking on specific nodes within a scene.
DisplayingOpening the State Machine Editor
The state machine editor is displayed by the following operations
- Expand [
Solution > StateMachines ]Machines] in the Solution Explorer.
- "State Machines" is expanded and "GlobalStateMachine" is displayed.


- "State Machines" is expanded and "GlobalStateMachine" is displayed.
Double-In the Solution Explorer select the "GlobalStateMachine". In the Properties panel check the [IsGlobal] property if it isn't checked already.- The [IsGlobal] checkbox is checked.
In the Solution Explorer double-click the "GlobalStateMachine".
- The State Machine Editor
panelwillappear.
The State Machine Editor panel can also be displayedopened byvia selectingthe menu bar [View > State Machine > State Machine EditorEditor].
With theThe State Machine Editor panel displayed, checkdisplays the PropertiesGlobalStateMachine's paneldiagram. andLike makeany surenewly thatcreated [ Is Global ] is checked. IfStateMachine, it iscontains notthe checked,following check it.elements:
GlobalStateMachine
rectangle
Represents a certain logic statusstatus. OnEntryActions and isOnExitActions associatedcan withbe aconfigured.
arrow
Transition from one State (enabled)to oranother. transitioningSender, out of a StateEvent and moving to another State (disabled).
Each action definedCondition for a State change is performed whentriggering the Statetransition iscan enabled/disabled.be configured.


State configurationConfiguration for Scene Car_Cluster
ToThe performfollowing screensteps transitions, setconfigure the State.GlobalStateMachine Thisto operationactivate isscene performedCar_Cluster afterwhen the entering the State Machine's "State" and to deactivate scene Car_Cluster when exiting the "State".
- The properties of the selected State are displayed in the Properties panel.
TheIn the State Machine Editor, the name of the StateonisthechangedState Machine Editor panel screen changesto "Car_Cluster".


Switch to theFusionpanelwillandbe opened, displaying the Fusion diagram for "Car_Cluster"is displayed..- The diagram contains two fusion nodes: Car_Cluster and Transition Request. The Transition Request Fusion node is connected to the
connectorCar_Cluster(at the On EntryActions)Actionsin the upper right corner of the Car_Cluster Fusion node.connector. - In the Transition Request Node, the [
RequestType ]RequestType] is set to "Active".


- The [
ChooseItem ]Item] dialogboxwillappears.be opened.




- The [
SelectBehavior ]Behavior] dialogappears.will be opened.


- The list of behaviors in the dialog is narrowed down to [
Action > Transition > TransitionRequest ]Request].
- A Transition Request Fusion node is linked to the "On Exit Actions" connector of the Car_Cluster Fusion node.


- With this setting, the Car_Cluster scene is
disableddeactivated whentransitioningexitingfrom thisState "Car_Cluster".
RequestType Deactivate Identifier Solution > Scenes > Car_Cluster
Editor is opened, displaying the GlobalStateMachine's diagram
Adding and configuringConfiguring "State"States for Scene Car_Status and Incoming_Call
ClickInonthe State Machine Editor, select the "Car_Cluster"StateState.onCopy the state either by right-clicking and selecting [Copy] from the context menu or via the keyboard-shortcut <Strg + C>.
state.

- A State named "Car_Cluster_1" will be
added.added to the State Machine diagram.
state "Car_Cluster_1".
TheIn the State Machine Editor, the name of StateonwillthebeStatechangedMachine Editor panel changesto "Car_Status".
Switch to theFusionpanelwillandbe opened, displaying the Fusion diagram for "Car_Status"is displayed..- The
connectorsdiagramoncontainsthe right side of thea Car_Status Fusion node(OnandEntrytwoActions/On Exit Actions) are connected to theTransition Request Fusionnodenodes, connected via the On Entry Actions and On Exit Actions connectors., respectively.
to the table below.
| On Entry Actions | |
| RequestType | Activate |
| Identifier | Solution>Scenes>Car_Status |
| On Exit Actions | |
| RequestType | Deactivate |
| Identifier | Solution>Scenes>Car_Status |
| Name | |
| Incoming_Call | |
| On Entry Actions | |
| RequestType | Activate |
| Identifier | Solution>Scenes>Incoming_Call |
| On Exit Actions | |
| RequestType | Deactivate |
| Identifier | Solution>Scenes>Incoming_Call |


The above operation completes the creation ofcreating States for transitionsour between the threeCluster scenes. The next step is to setconfigure upthe transitionstransition logic between eachthese State.States.