1 Reply Latest reply on Jan 21, 2013 4:40 PM by dward

    Switchyard Rule Service. Retract facts

    anikulin

      Hi

       

      I was working with Switchyard Rule Service and now face with problem of retracting in Working Memory.

       

      I have such configuration of my rules service:

       

                <rules:implementation.rules

                      xmlns:rules="urn:switchyard-component-rules:config:1.0" agent="true" eventProcessing="CLOUD">

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

                      <rules:resource location="META-INF/ChangeSet.xml"

                          type="CHANGE_SET" />

                      <rules:globals>

                          <rules:mapping expression="message.content.modifiedOrderList" variable="modifiedOrderList" />

                      </rules:globals>

                      <rules:facts>

                          <rules:mapping expression="message.content.data"/>

                      </rules:facts>

                  </rules:implementation.rules>

       

      I use Stateful session and every time when I invoke sendData method, service inserts message.content.data fact into WorkingMemory. If i invoke this method multiple times, i have a lot of facts in WorkingMemory, but i want to retract inserted facts after method execution or have in memory only the latest one. Can i do retracting using switchyard rule service configuration

       

      Thanks, Anton

        • 1. Re: Switchyard Rule Service. Retract facts
          dward

          There is no action type (or any other mechanism) in SwitchYard's Rules component that will retract facts for you.  However, you can do this via DRL itself, or you can register an event listener (of your own implementation) in the Rules component where you do this work yourself.