5 Replies Latest reply on Jan 16, 2013 7:10 AM by dward

    How to specify the entrypoint for a CEP rule service?

    magick93

      Hi

       

      I'm wondering, how does one specify the entry point in for an event in a rule service?

       

      Please see http://docs.jboss.org/drools/release/5.5.0.Final/drools-fusion-docs/html_single/index.html#d0e514 for more of an explanation.

       

      Thanks,

        • 1. Re: How to specify the entrypoint for a CEP rule service?
          magick93

          Ok, I found what I suspect is the answer - using the search function

           

          <rules:action name="sendData" type="FIRE_ALL_RULES" entryPoint="AccountData"/>

          • 2. Re: How to specify the entrypoint for a CEP rule service?
            magick93

            So I'm still unable to get my rule to fire when in FIRE_ALL_RULES mode, but it does using Execute.

             

            This is the only difference from the switchyard perspective:

            <rules:action name="sendData" type="FIRE_ALL_RULES" entryPoint="AccountData"/> 



            And when I use EXECUTE the rule fires.


            When I use FIRE_ALL_RULES, it never gets activated.

            Does anyone know what I might be doing wrong?


            This is my rule:

                     rule "TEST-CEP"

                 agenda-group "TestAgenda"

                 no-loop true

                 dialect "mvel"

                 when

                     Tick( ) over window:time (1m) from entry-point "AccountData"

                 then

                     TradeOrder newTrade = new TradeOrder();

                     newTrade.setSymbol( "TEST" );

                     newTrade.setVolume( 1 );

                     newTrade.setusername( "4002642" );

                     newTrade.setStatus( OrderStatus.OPENING );

                     insert( newTrade );

                     modifiedOrderList.add(newTrade);

            end

             

            And I have it declared as an event like so:

            declare Tick

                      @timestamp(value = tickTime)

                      @expires(value = 5m)

                      @role(value = event)

            end


            • 3. Re: How to specify the entrypoint for a CEP rule service?
              dward

              In Switchyard < 0.7 (I'm guessing you're using 0.6), there are two stateful session action types: FIRE_ALL_RULES and FIRE_UNTIL_HALT. The latter is intended for CEP applications, so use that.  Additionally, you should set the eventProcesing attribute of implementation.rules to STREAM (the default is CLOUD).

              • 4. Re: How to specify the entrypoint for a CEP rule service?
                magick93

                Thanks David, I really appreciate your help - and your work.

                • 5. Re: How to specify the entrypoint for a CEP rule service?
                  dward

                  You're welcome. Thanks for your interest in SwitchYard!