def set_state_machine()

in infra/userportal/states/interfaces.py [0:0]


  def set_state_machine(self, state_machine_name:str, definition:sf.IChainable)->None:
    '''
    Creates the state machine from definition with a given name.
    :param state_machine_name: The name of the state machine.
    :param definition: The state machine activity flow.
    '''
    assert state_machine_name is not None, "state_machine_name not specified"
    assert definition is not None, "definition not specified"
    assert self.__state_machine is None, "set_state_machine called multiple times."

    '''
    API Gateway integrates with Step Function Express.
    However, the solution also creates Step Function Standard workflows.
      Standard workflows are easier to debug and troubleshoot via the console.
      They serve no purpose other than improving developer experience.
    '''
    suffix = ''
    if self.state_machine_type == sf.StateMachineType.STANDARD:
      suffix = '_Debuggable'

    self.__state_machine = sf.StateMachine(self,'StateMachine',
      state_machine_name='{}{}'.format(state_machine_name, suffix),
      state_machine_type= self.state_machine_type,
      tracing_enabled=True,
      definition= definition,
      timeout= max_runtime,
      logs= sf.LogOptions(
        include_execution_data=True,
        level = sf.LogLevel.ALL,
        destination= self.log_group
      ))