public String select() { boolean isOutcome = conversationIdOrOutcome==null || (!Character.isDigit(conversationIdOrOutcome.charAt(0)) && conversationIdOrOutcome.indexOf(':') < 0); String actualOutcome; if (isOutcome) { resultingConversationIdOrOutcome = conversationIdOrOutcome; actualOutcome = conversationIdOrOutcome; } else { ConversationEntry ce = ConversationEntries.instance().getConversationEntry(conversationIdOrOutcome); if (ce!=null) { resultingConversationIdOrOutcome = ce.getId(); ce.redirect(); } actualOutcome = null; } return actualOutcome; }
public boolean redirect() { String viewId = getViewId(); if (viewId==null) { return false; } else { Manager.instance().redirect( viewId, getId() ); return true; } }
private void destroyNestedConversationContexts(Map<String, Object> session, String conversationId) { List<ConversationEntry> entries = new ArrayList<ConversationEntry>( ConversationEntries.instance().getConversationEntries() ); for ( ConversationEntry ce: entries ) { if ( ce.getConversationIdStack().contains(conversationId) ) { String entryConversationId = ce.getId(); log.debug("destroying nested conversation: " + entryConversationId); destroyConversation(entryConversationId, session); } } }
public void destroy() { boolean success = Manager.instance().switchConversation( getId() ); if (success) Manager.instance().endConversation(false); }
@Create public void createSelectItems() { ConversationEntries conversationEntries = ConversationEntries.getInstance(); if (conversationEntries==null) { selectItems = Collections.EMPTY_LIST; } else { Set<ConversationEntry> orderedEntries = new TreeSet<ConversationEntry>(); orderedEntries.addAll( conversationEntries.getConversationEntries() ); selectItems = new ArrayList<SelectItem>( conversationEntries.size() ); for ( ConversationEntry entry: orderedEntries ) { if ( entry.isDisplayable() && !Session.instance().isInvalid() ) { selectItems.add( new SelectItem( entry.getId(), entry.getDescription() ) ); } } } }
log.debug("conversation timeout for conversation: " + conversationEntry.getId()); log.debug("destroying conversation with garbage lock: " + conversationEntry.getId()); Events.instance().raiseEvent(EVENT_CONVERSATION_TIMEOUT, conversationEntry.getId()); destroyConversation( conversationEntry.getId(), session );