6 Replies Latest reply on Dec 21, 2009 9:56 AM by camunda

    jpdl syntax for ejb method invoke activity

    tom.baeyens

      Koen wrote:

      <ejb name="calculate"
       jndi="CalculatorBean"
       method="add"
       var="answer"
       g="96,16,83,52">
      
       <arg><int value="25"/></arg>
       <arg><int value="38"/></arg>
      
       <transition to="wait" />
       </ejb>
      


        • 1. Re: jpdl syntax for ejb method invoke activity
          tom.baeyens

          I think the invoking an ejb should be called just 'java'

          As the java activity actually means invoke a java method. At least, that is the reasoning behind it.

          Some more questions we need to think about:

          1) there is a <jndi jndi-name="..." /> element in the wiring section of jpdl. What is then the most consistent way of naming the jndi element ? In that case the full element specifies only jndi so i don't really know what is the most consistent here.

          2) do we need to distinct between session and entity beans ? or can we use reflection to find out ? or maybe that doesn't matter any more in ejb 3 ? i don't know.

          but if we need to make a distinction in the language between session and entities, we might have to consider attributes like session-ejb-jndi-name and entity-ejb-jndi-name.

          • 2. Re: jpdl syntax for ejb method invoke activity
            tom.baeyens

             

            "Koen" wrote:
            Do we only target ejb3 or also ejb2 ?


            I think ejb 3 to get started with in incubation. Then if we get enough requests for ejb 2 we can consider it.

            If we tackle it later, do you think it could impact the current attributes ?

            • 3. Re: jpdl syntax for ejb method invoke activity
              jbarrez

               

              "tom.baeyens@jboss.com" wrote:
              I think the invoking an ejb should be called just 'java'


              I agree. As Ronald also stated before, this makes a lot of sense in for example a Seam environment.

              "tom.baeyens@jboss.com" wrote:

              1) there is a <jndi jndi-name="..." /> element in the wiring section of jpdl. What is then the most consistent way of naming the jndi element ? In that case the full element specifies only jndi so i don't really know what is the most consistent here.


              Where is that jndi element used today?
              I think an attribute makes sense.

              "tom.baeyens@jboss.com" wrote:

              2) do we need to distinct between session and entity beans ? or can we use reflection to find out ? or maybe that doesn't matter any more in ejb 3 ? i don't know.


              EJB 3 'entity beans', or JPA, don't have a JNDI name. So this use case doesn't make much sense.

              "tom.baeyens@jboss.com" wrote:

              I think ejb 3 to get started with in incubation. Then if we get enough requests for ejb 2 we can consider it.


              I agree. EJB3 is the way to go.


              • 4. Re: jpdl syntax for ejb method invoke activity
                koen.aers

                Ok, these opinions are pretty clear and a lot like I anticipated.

                Cheers,
                Koen

                • 5. Re: jpdl syntax for ejb method invoke activity
                  kukeltje

                  Since Joram referred to a remark I made earlier, let me add something else I mentioned.

                  What is the added value of using a jndi attribute if there is an 'expression' attribute? The (jndi) name of an ejb can be put in there in the form of an EL expression. That is just like what seam does when injecting stuff. It does not matter if it is an ejb, springbean, seam (weld/cdi) component or whatever. We just need to have the correct resolvers in place...

                  Oh.. and yes, just EJB3 please.

                  Oh, and state that it (initially?) only is local ejb's otherwise a (remote) initialcontext is needed as well

                  • 6. Re: jpdl syntax for ejb method invoke activity
                    camunda

                    +1 for the EJB3 SessionBeans. I don't really have an oppinion on the JNDI-Name, can you maybe post an example how it should look like?

                     

                    Because you asked about the EJB3/JPA Entities: Supporting them as process variable still makes a lot of sense, we did that in a POC already, but it is a bit tricky which EntityManager should be used. So it make sense to have that, but a completly different issue than calling a session bean.