Skip to main content

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

  1. Expand [ Solution > State Machines ]Machines] in the Solution Explorer.
    • "State Machines" is expanded and "GlobalStateMachine" is displayed.
      drawing-4-1714391154.pngdrawing-4-1714391154.png


  2. 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.
    The "GlobalStateMachine" is global.

    In the Solution Explorer double-click the "GlobalStateMachine".
    • The State Machine Editor panel will appear.
    be opened.

    The State Machine Editor panel can also be displayedopened byvia selectingthe menu bar [View > State Machine > State Machine EditorEditor].

    ] on the menu bar from "View".

    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

    consistsof   Visual representation Explanation Initial State (circle icon), Transition (arrow), and State (rectangle) by default.
    Initial State is the entryEntry point for the state machine. State represents

    rectangle

    Represents a certain logic statusstatus. OnEntryActions and isOnExitActions associatedcan withbe aconfigured.

    series of actionswhenTransition transitioning into

    arrow

    a

    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.

    drawing-5-1726822092.pngdrawing-5-1726822092.png


    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".

      In the State Machine Editor is displayed in Displayingselect the State Machine Editor operation.
        Click State on the State Machine Editor panel.State.
        • The properties of the selected State are displayed in the Properties panel.

        In the Properties panel, change the [ Name ]Name] of the General category to "Car_Cluster".
        • TheIn the State Machine Editor, the name of the State onis thechanged State Machine Editor panel screen changes to "Car_Cluster".
          drawing-5-1726822161.pngdrawing-5-1726822161.png

        WithWhile "Car_Cluster" selected,is fromselected the lower left ofin the State Machine Editor panel,Editor, click on the [ Fusion...] ]button in the State Machine Editor's left lower half.
        • Switch to the Fusion panelwill andbe 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 Entry Actions)Actions in the upper right corner of the Car_Cluster Fusion node.connector.
        • In the Transition Request Node, the [ RequestType ]RequestType] is set to "Active".
          drawing-4-1714391578.pngdrawing-4-1714391578.png

        ClickIn the Transition Request Fusion node, click on the Select item icon to the right of the [ Identifier ] in the Transition Request Fusion node.Identifier].
        • The [ Choose Item ]Item] dialog boxwill appears.be opened.
          drawing-4-1714391725.pngdrawing-4-1714391725.png

        Select [ Solution>Scenes>Car_Cluster ] fromIn the listChoose onItem dialog, navigate to and select [Solution > Scenes > Car_Cluster], then press the right side of the dialog and press [ OK ]OK] button.
          The [Choose Item] dialog will be closed. With this setting, the "Car_Cluster" scene will be enabledactivated when transitioning to thisentering State "Car_Cluster".
          drawing-4-1714391771.pngdrawing-4-1714391771.png


          DragIn the connectorState (OnMachine ExitEditor, Actions) in the lower right corner ofclick the Car_Cluster Fusion node,node's moveOn theExit mouse,Actions and release left click anywhere.connector.
          • The [ Select Behavior ]Behavior] dialog appears.will be opened.
            drawing-4-1714391809.pngdrawing-4-1714391809.png

          EnterIn the [Select Behavior] dialog's search field, enter "Transition Request " in the search field at the top of the dialog..
          • The list of behaviors in the dialog is narrowed down to [ Action > Transition > Transition Request ]Request].

          Double-In the [Select Behavior] dialog, double-click "Transition Request".
          • Transition Request Fusion node is linked to the "On Exit Actions" connector of the Car_Cluster Fusion node.
            drawing-4-1714391889.pngdrawing-4-1714391889.png

          TheIn Fusion configure the newly created following settings are made for the Transition Request Fusion nodenode, that is connected to the "On Exit Actions" connectorconnector, according to the table below.
          • With this setting, the Car_Cluster scene is disableddeactivated when transitioningexiting from this State "Car_Cluster".
            RequestType Deactivate
            Identifier Solution > Scenes > Car_Cluster
          ClickSwitch back to the State Machine Editor either via the up arrow icon in the upper right corner of the Fusion panel toor switchusing the displaytabs toof the open Scene Composer editors.
            The State Machine Editor.

            Editor is opened, displaying the GlobalStateMachine's diagram

             

            Adding and configuringConfiguring "State"States for Scene Car_Status and Incoming_Call

            1. ClickIn onthe 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>.
              drawing-4-1707889373.png

            Click anywhere into the State Machine Editor andto select [ Copy ] fromdeselect the contextCar_Cluster menu.
            state
            .
            drawing-4-1707889373.png
            Then
            Anywhere inpaste the state machineeither editor,by bringright-clicking upand selecting [Paste] form the context menu andor selectvia [the Pastekeyboard-shortcut ]<Strg + P>.
            • A State named "Car_Cluster_1" will be added.added to the State Machine diagram.

            Click on "Car_Cluster_1" onIn the State Machine EditorEditor, panel screen.
              The properties of "Car_Cluster_1" will appear inselect the Propertiesnew panel.

              state
              "Car_Cluster_1". In the Properties panel, change the [ Name ]Name] of the General category to "Car_Status".
              • TheIn the State Machine Editor, the name of State onwill thebe Statechanged Machine Editor panel changes to "Car_Status".

              WithWhile "Car_Status" selected,is fromselected the lower left ofin the State Machine Editor panel,Editor, click on the [ Fusion...] ]button in the State Machine Editor's left lower half.
              • Switch to the Fusion panelwill andbe opened, displaying the Fusion diagram for "Car_Status" is displayed..
              • The connectorsdiagram oncontains the right side of thea Car_Status Fusion node (Onand Entrytwo Actions/On Exit Actions) are connected to the Transition Request Fusion nodenodes, connected via the On Entry Actions and On Exit Actions connectors., respectively.

              SetIn Fusion, configure the Transition Request asaccording follows
              to the table below
              .
                The configuration of State Car_Status is completed.
                On Entry Actions
                RequestType Activate
                Identifier Solution>Scenes>Car_Status
                On Exit Actions
                RequestType Deactivate
                Identifier Solution>Scenes>Car_Status
                Repeat the stepsteps 1 through step 6 above, to add another State and makefor the followingIncoming_Call settings.scene. Configure the State according to the table below.
                  A new state for Incoming_Call has been created and configured. In State Machine Editor, the diagram of the GlobalStateMachine looks like in the figure below.
                  Name
                  Incoming_Call
                  On Entry Actions
                  RequestType Activate
                  Identifier Solution>Scenes>Incoming_Call
                  On Exit Actions
                  RequestType Deactivate
                  Identifier Solution>Scenes>Incoming_Call
                  After all steps are completed, the state machine editor will look like below figure.
                  drawing-4-1714391994.pngdrawing-4-1714391994.png

                  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.