5 Replies Latest reply on Aug 9, 2007 3:59 AM by porcherg

    Questions about the Susbscribe wire operation

    porcherg

      I have two questions about this operation :

      1) I don't see where the class WireEventObjectFilter defined in org.jbpm.wire.operation.SubscribeOperation is used.
      I think this class can be used to filter wire events linked to a specific object, but in the actual code we subscribe directly to the Descriptor of this object.
      Is this class used or can it be removed ?


      2) the "to" attribute of the xml element "subscribe" is now only used for subscribing to "wire-events" ( we can only have "to='wire-events'").
      Will other categories of events be added ? Will they be handled separately or will there be a common filtering class (just as FilterListener for event names but based on the type of the event)

      regards,
      Guillaume

        • 1. Re: Questions about the Susbscribe wire operation
          tom.baeyens

          1) yes. that can be removed. well spotted!

          2) no other categories are planned. the to='wire-events' is constructed that way to make the xml as readable as possible. it would be good if in the main class' javadocs, there would be an overview of the list of possible subscribe syntaxes. that can also be a basis for discussing alternative syntaxes if you think those are more appropriate.

          • 2. Re: Questions about the Susbscribe wire operation
            tom.baeyens

            actually i'm not sure if i understood your point 2 correctly. let me know if my answer didn't match your question :)

            • 3. Re: Questions about the Susbscribe wire operation
              porcherg

               

              "tom.baeyens@jboss.com" wrote:
              actually i'm not sure if i understood your point 2 correctly. let me know if my answer didn't match your question :)


              My problem in point 2 was that the "to" attribute for me has a generic meaning (that is why I spoke about event categories).

              If it will be used only for subscribing to wire events, maybe we can rename it to "wire-events". This way, we will have "wire-events='true'" to subscribe to wire-events.

              What do you think about this change ?

              • 4. Re: Questions about the Susbscribe wire operation
                tom.baeyens

                in that case i did understand your point correctly. i did consider your alternative. i didn't do it because i reconed that

                <subscribe to='wire-events' object='mySession' ...


                is more readable then

                <subscribe wire-events='true' object='mySession' ...


                let me know if you have arguments for the alternative

                • 5. Re: Questions about the Susbscribe wire operation
                  porcherg

                  I read the code again and here is what I understood :

                  in this case:

                  <subscribe to='wire-events' object='mySession' />

                  the listener subscribes to events fired by the Descriptor of the object "mySession"

                  in this case:
                  <subscribe object='mySession' />

                  the listener subscribes to the events fired by the object "mySession"

                  Am I right ?

                  In this case, the name 'to' can be a good choice and we could use to='object|wire' or to='object-events|wire-events' (or to='object|descriptor') with object as the default value.

                  Regards,
                  Guillaume