@classmethod
def delete_states(cls, pattern: str):
    """
        Delete the states from redis that matches the pattern
        :param pattern: pattern
        :return:
        """
    r = cls().get_redis()
    if not r:
        raise Exception('redis connection not established')
    redis_state_keys = r.keys(pattern)
    for key in redis_state_keys:
        r.delete(key)
