/** * Begin or join a conversation, or begin a new nested conversation. * * @param join if a conversation is active, should we join it? * @param nested if a conversation is active, should we start a new nested conversation? * @return true if a new long-running conversation was begun */ public boolean begin(boolean join, boolean nested) { boolean longRunningConversation = Manager.instance().isLongRunningOrNestedConversation(); if ( !join && !nested && longRunningConversation ) { throw new IllegalStateException("begin() called from long-running conversation, try join=true"); } else if ( !longRunningConversation ) { reallyBegin(); return true; } else if (nested) { beginNested(); return true; } else { return false; } }