3 Replies Latest reply on Sep 13, 2007 8:24 AM by baz

    Long-running conversations and EntityHome

      EntityHome is quite a useful class. Extend it, and you can create, update, and delete entities easily.

      The problem with it is that it's a POJO. I tried everything I could think of, but could not get it to exist in a long-running conversation. This limits its usefulness.

      So, I created a local interface and implemented it.

      The problem is that there is a remove() method in the EntityHome class, and when it becomes a SFSB, JBoss gets confused about whether remove() is the remove method, or the @Remove annotated method is the remove method. That makes it not work.

      Is there a solution to this, other than to not try to make EntityHome into a SFSB?

        • 1. Re: Long-running conversations and EntityHome
          matt.drees

          EntityHome is conversation-scoped. It gets used in long-running conversations in seam-gen apps. So I don't think there's a need to turn it into an SFSB.

          • 2. Re: Long-running conversations and EntityHome
            baz

            I do a wild guess that your problem could be related with mine.

            I do have no problem do work with entityHome Objects in the way which is used in a semgen generated app.
            But...
            When i try to initialize an entityHome from a javabean, no luck.
            What i am trying to do is this:

            @Name("genFieldplan")
            //@Scope(ScopeType.CONVERSATION)
            public class GenerateFieldplanBacking {
            [...]
             public void fetchEvaluation(){
             log.info("UserEvaluationId : #0",calcEvaluationId());
             evaluationHome.setEvaluationEvaluationId(calcEvaluationId());
            // Evaluation evaluation = evaluationHome.getInstance();
            // log.info("evaluation: #0, ID: #1",evaluation,(evaluation==null?null:evaluation.getEvaluationId()));
             }
            

            this code is called from this page:
            <h:form>
             <h:commandButton action="#{genFieldplan.fetchEvaluation}" id="search" value="Search for Evaluation" />
            </h:form>
             <rich:panel >
             <f:facet name="header">Evaluation</f:facet>
            
             <s:decorate id="evaluationId" template="/layout/display.xhtml">
             <ui:define name="label">evaluationId</ui:define>
             #{evaluationHome.instance.evaluationId}
             </s:decorate>
            [...]
            

            What happens is this:
            If no long running conversation is active, after pressing the commandbutton the evaluation is shown.

            When i start a long-running-conversation(in *.page.xml for the page)
            no evaluation is shown after pressing the button.

            Is this what you mean?
            And for others what do i make wrong? Any hints are welcomed
            Ciao,
            Carsten

            • 3. Re: Long-running conversations and EntityHome
              baz

              I extended my page with this code:

              <s:decorate id="evaluationIdHome" template="/layout/display.xhtml">
               <ui:define name="label">Home evaluationId</ui:define>
               #{evaluationHome.evaluationEvaluationId}
               </s:decorate>
              

              If my page starts a conversation this happens:
              the home evaluationId is set correctly, but the instance id is empty.

              When my page does not start a conversation, all is well as stated above.