3 Replies Latest reply on Jul 3, 2013 11:34 AM by dward

    Channels missing in drools

    czenrezig

      Hello

       

      We are currently investigating Event Processing in Switchyard 0.8.

      What we are trying to do is to send facts to the Drools service, process them and distribute results through channels.

      However we cannot access channels from drools. Neither channel listing through drools global nor direct access to the channels object works.

      Apparently, there are no channels being registered.

       

      We are trying to register a channel as follows:

      <sca:service name="EventProcessingDrools" promote="Events/EventProcessingDrools">

            <sca:interface.java interface="com.example.EventProcessingDrools"/>

          </sca:service>

          <sca:component name="Events">

            <rules:implementation.rules>    

                 <rules:channels>

                <rules:channel class="com.example.impl.ChannelExample" name="ChannelExample"/>

                <!-- <rules:channel class="com.example.ConfigurationService" name="ConfigurationService" operation="updateConfiguration" reference="ConfigurationService"/> -->

              </rules:channels>     

              <rules:manifest>       

                <rules:resources>         

                  <rules:resource location="Events.drl" type="DRL"/>           

                </rules:resources>         

              </rules:manifest>

            </rules:implementation.rules>

            <sca:service name="EventProcessingDrools">

              <sca:interface.java interface="com.example.EventProcessingDrools"/>

            </sca:service>

            <sca:reference name="ConfigurationService">

              <sca:interface.java interface="com.example.ConfigurationService"/>

            </sca:reference>

          </sca:component>

       

      What we have realized is that even when we are trying to use a switchyard service as a channel, the "rules:channel" element requires a class attribute.

       

      I would appreciate any advice on this problem.

       

      Cheers,

      Wojtek

        • 1. Re: Channels missing in drools
          dward

          You have not configured any actions (soon to be renamed to operations).  The default action type is "EXECUTE", which means a stateless knowledge session is used.  Currently, it is a known issue that Channels are only registered for stateful knowledge sessions (which get created for the other actions types: "INSERT, FIRE_ALL_RULES, and FIRE_UNTIL_HALT").  I am currently looking at registering Channels for stateless sessions too.

          • 2. Re: Channels missing in drools
            dward

            Unfortunately, it doesn't appear that the KIE/Drools/jBPM API allows for registering Channels on stateless knowledge sessions - only stateful.  If you defined an action with a type="FIRE_ALL_RULES" in your example, you should see the channel get registered.

            • 3. Re: Channels missing in drools
              dward

              I've added a jira to allow for Channels to be registered for stateless sessions: SWITCHYARD-1576 .  Please also note the associated bugzilla.