Advanced Control Flow in UIPath: State Machines

Jun 28, 2024

Advanced Control Flow in UIPath: State Machines

Introduction

  • Topic: Advanced Control Flow
  • Component: State Machine
  • Focus: When and how to use State Machines in projects
  • Example Course: 'State Machine in UA Studio 2022 do10'

Key Concepts

State Machine Layouts in UIPath

  1. Sequence: Linear representation
    • Keywords: Linear, Uncomplicated, Top to Bottom
    • Use Cases: Procedural workflows, step-by-step navigation, and typing in UI automation tasks
  2. Flowchart: Flexibility and visual appeal
    • Keywords: Two-dimensional format, Decision points, Multiple branching logical operators, Complex business processes
    • Use Cases: Flexible connection of activities, decision points, complex business processes
  3. State Machine: Interconnected states and transitions
    • Keywords: Transitions, Event-driven, High-level project organization, Continuous processes
    • Use Cases: Complex and continuous processes, RPA frameworks such as REFramework

State Machine Components

  1. State Machine Activity (Scope Activity)
    • Contains a Start Node
  2. State Activity
    • Three Sections: Entry, Exit, Transitions
    • First state connected to start node is Initial State
  3. Final State Activity
    • Contains only the Entry Section

Key Differences

  • State Activity: Entry, Exit, and Transition sections
  • Final State Activity: Only the Entry section

Practical Example

  • Use Case: Simulate a customer care center for different types of travel bookings (bus, train, flight)
  • Initial State: A message box that prompts users to continue or exit
  • Transitions: Based on user choices ’OK’ or ‘Cancel’
  • Final State: Displays a message, 'Thanks, visit again'.

Notes on Final State Usage

  • A final state can only have one transition
  • It contains only an entry section

Practical Exercise

  • Create a state machine to prompt user selection (bus, train, or flight)
  • Based on selection, navigate the user to the respective state with information on ticket counters
  • Demonstrate usage of Entry and Exit sections
  • Detailed coverage of conditions and transitions in state activities

Important Points for Exam

  • Initial State: Only one initial state per state machine
  • Final State: Can have multiple final states
  • Transition Sections: Three sections—Trigger, Condition, Action
  • Operations:
    • Transitions are automatically created when linking states
    • One state can have multiple transitions
    • Conditions and transitions are evaluated in the order they appear