11 Replies Latest reply on Jan 24, 2007 6:07 AM by tom.baeyens

    JMS Example in 3.2 Beta

    jeffdelong

      There is a JMS Example (examples/jms) in the 3.2 Beta, however it does not appear to be complete. Can anyone provide more information on this example, as I am looking to do something very similar for the ESB project.

      Thanks,

      Jeff

        • 1. Re: JMS Example in 3.2 Beta
          tom.baeyens

          i think that originated from an initial attempt to implement the jms based message service that someoen contributed. because i didn't want to throw it away, i moved it to the examples.

          i don't think we need it any more

          can be removed, i think.

          • 2. Re: JMS Example in 3.2 Beta
            jeffdelong

            Actually this looks more like a usage example - i.e., start a process vis tha command listener. I think it would be good to have such an example. This one could probably be fixed up to work.

            By the way, in looking at CommandListenerBean, it looks for a jobId, which it does not appear to use except to log. What should a client starting a process via the command listener set the jobId to be (since it not really a Job)? Set it to zero?

            • 3. Re: JMS Example in 3.2 Beta
              jeffdelong

              I see another issue with using the CommandListenerInterface to start a process: the NewProcessInstanceCommand does not automatically signal the processInstance to advance the token. Thus, a second JMS message is required to signal the processInstance, but since the original message has no way to return a processInstanceId, there is no way to know which processInstance to signal. Also, the SignalCommand has a tokenId, but no processInstanceId (even if there were a way to return the processInstanceId).

              • 4. Re: JMS Example in 3.2 Beta
                tom.baeyens

                there is a composite command. so you can chain commands. commands can pass a return value to the next command in the chain.

                that way it should be possible to combine the commands (even in one tx)

                but double check what i'm saying cause it was a long time ago and i might not remember correctly

                • 5. Re: JMS Example in 3.2 Beta
                  jeffdelong

                  The problem here is that the second command (SignalCommand) needs the tokenId created from executing the first command (NewProcessInstanceCommand).

                  Another approach would be to hace the NewProcessInstanceCommand signal when there are no start tasks. It is hard to imagine any other situation where the user would want to create a processInstance and not signal it.

                  • 6. Re: JMS Example in 3.2 Beta
                    jeffdelong

                    So what do you think, can we modify the NewProcessInstanceCommand to signal when there are no start tasks?

                    • 7. Re: JMS Example in 3.2 Beta
                      jeffdelong

                      My understanding is that the CommandListenerBean and CommandServiceBean are designed to handle any Command (that has a class defined that implements the Command interface), not just Job Commands. However, it appears the CommandListenerBean always creates a ExecuteJobCommand, which tries to load a job using the jobId..

                      I think CommandListernerBean should check for the presence of a JobId (or non 0 jobId), and if not present, then not create a ExecuteJobCommand, but instead get the command from the message and execute it. Currently, the code does not even look in the message for a command, but always assumes its a job and gets it from the Job table.

                      • 8. Re: JMS Example in 3.2 Beta
                        jeffdelong

                        Tom addressed these issues through:

                        http://jira.jboss.com/jira/browse/JBPM-824
                        http://jira.jboss.com/jira/browse/JBPM-825

                        However,

                        1) The JMSMessage Service is getting a ClassCastException when casting the lookup of java:/JmsXa to an XAConnectionFactory which should work and did work previously.

                        2) The NewProcessInstance command needs to set the variablesMap contained with the command.

                        • 9. Re: JMS Example in 3.2 Beta
                          tom.baeyens

                           

                          "jeffdelong" wrote:

                          1) The JMSMessage Service is getting a ClassCastException when casting the lookup of java:/JmsXa to an XAConnectionFactory which should work and did work previously.


                          i don't recall this in the testing that i did. have you got any clues that could help me reproduce ?

                          "jeffdelong" wrote:

                          2) The NewProcessInstance command needs to set the variablesMap contained with the command.


                          this is now added in cvs. thanks !

                          • 10. Re: JMS Example in 3.2 Beta
                            jeffdelong

                            I have a simple process that has an action. I configured the action with async="yes", and got a ClassCastException in the JMSMessageService when it casts to an XAConnnectionFactory the result of the lookup of Jms:/XA

                            • 11. Re: JMS Example in 3.2 Beta
                              tom.baeyens

                              i'll check that out this afternoon. weird... the tests should have been able to reproduce that question.