0 Replies Latest reply on Aug 12, 2010 4:00 AM by Uwe Rasmus

    Annotation @Begin(join=true) NEVER joins conversation

    Uwe Rasmus Newbie

      Hi,
      I have a problem. This very easy code never joins a conversation. It always starts a new conversation. The only possible way not to create conversation is return null, but that's unfortunately not acceptable.


      @Name("starter")
      @Scope(ScopeType.CONVERSATION)
      public class Starter {
              @Begin(join = true)
              public String shouldJoin() {
                      System.out.println("whatever");
                      return "anything";
              }
      }

      The call from menu.xhtml is this:
      <s:link id="menuHoleId" view="/starter.xhtml" action="#{starter.shouldJoin()}" value="joiner"/>
      The starter.xhtml is just empty page.
      After each click to the link, one conversation is created and displayed below on the page with this code:
      <h:form>
          <h:dataTable value="#{conversationEntries.conversationEntries.toArray()}" var="entry"
              rendered="#{not empty conversationEntries.conversationEntries.toArray()}">
          <h:column>
              <f:facet name="header">Workspace</f:facet>
              <h:commandLink action="#{entry.select}" value="#{entry.description}"/>
              <h:outputText value="[current]" rendered="#{entry.current}"/>
          </h:column>
          <h:column>
              <f:facet name="header">View</f:facet>
              <h:outputText value="#{entry.viewId}"/>
          </h:column>
          <h:column>
              <f:facet name="header">Id stack</f:facet>
              <h:outputText value="#{entry.conversationIdStack}"/>
          </h:column>
          <h:column>
              <f:facet name="header">long running?</f:facet>
              <h:outputText value="#{conversation.longRunning ? 'long running' : 'temporary'}"/>
          </h:column>
          <h:column>
              <f:facet name="header">Activity</f:facet>
              <h:outputText value="#{entry.startDatetime}">
                  <s:convertDateTime type="time" pattern="hh:mm a"/>
              </h:outputText>
              <h:outputText value=" - "/>
              <h:outputText value="#{entry.lastDatetime}">
                  <s:convertDateTime type="time" pattern="hh:mm a"/>
              </h:outputText>
          </h:column>
          <h:column>
              <f:facet name="header">Action</f:facet>
              <h:commandButton action="#{entry.select}" value="Switch"/>
              <h:commandButton action="#{entry.destroy}" value="Destroy"/>
          </h:column>
      </h:dataTable>
      </h:form>


      Can anyone explain me, what's happening and why the conversation is not joined? This code is shown everywhere, I just can't believe it's wrong and it doesn't work, but I cannot find what I do wrong...
      Thanks a lot
      Uwe