Harena Message Protocol

Pattern to Build the Message Hierarchy

<entity>/<action>/<identifier>

Cycle of a Player

  1. user login
    • user/login/<user id> - notifies the user login and its id
  2. user selects a case to play

    • case/get/<case id> - loads and returns the markdown of the case

    • Harena compiles the case

    • case/ready/<case id> - indicates that case is loaded, compiled, and ready to run

    • case/start/ - demarks the start of a case by the user

    • knot/navigate/<< - navigates to the first knot of the case

    • knot/start/<knot id> - indicates that the knot <knot id> started

      • demarks when the user starts to play the knot - used to track how much time the user will spend in this knot
      • example: knot/start/Day_1 - notifies that Day_1 started
  3. user types an answer to a question (variable related hypothesis)

    • for each typed key: input/typed/<knot id>/<var name>
      • the names of variables are preceded by the knot id, so their scope is restricted to the knot, i.e., the same variable name in two knots can have distinct values
      • example: for each typed key in an input in the knot Day_1 whose related variable name is hypothesis: input/typed/Day_1/hypothesis
    • input/changed/<knot id>/<var name> - user confirms the input (tab to leave the field or click in another button/field)
      • example: input/changed/Day_1/hypothesis - user confirms the input related to the variable hypothesis in the knot Day_1
  4. user clicks on button Next to go no the next knot

    • flow/navigate/> - navigates to the next knot in the flow (see the topic: Navigating through knots)

    • input/submit/* - before leaving the knot, this message requests to all components to notify any value to be recorded

    • every value produced in the knot (e.g., data from the input fields) will be persisted by the following message

    • var/set/<knot id>/<var name> - stores the value of a variable in the State Mechanism (an Harena mechanism that persists values of variables during the entire case)
      • example: var/set/Day_1/hypothesis - stores the Day_1.hypothesis variable in the State Mechanism
    • knot/end/<knot id> - indicates that the knot <knot id> ended
      • demarks when the user ends playing this knot - used to track how much time the user spent in this knot
      • example: knot/end/Day_1 - indicates the end of Day_1 knot execution
  5. the previous cycle follows until the user reaches a knot assigned as the end knot

    • case/completed/<instance id> - indicates that the user reached the last knot of the case and that the case was completed

    • case/summary/<instance id> - a special message dispatched in the end of the case by the State Machine summarizing: (i) the sequence of knots visited by the user with timestamp; (ii) the value of all variables defined during the case

Navigating through the Knots

The following messages are triggered whenever there is a request to the player to navigate to another knot or case. Each type requests a navigation to:

Some User Actions

Entity: template_family

Entity: template

Entity: case

Entity: knot

<knot title> - The title given by the author to the knot in the case. <knot id> - Uniquely identifies a knot. Derived from the knot title replacing spaces for underscores (as we do not use spaces in the topics).

Entities: input and variable

Variable input cycle:

Details

Messages Not Persisted

Under Construction

Messages to coordinate DCCs.

Entity: dcc-block

Operations:

Entity: dcc-state-select

Operations: