2010/8/29 Tina Vießmann <span dir="ltr">&lt;<a href="mailto:tviessmann@stud.hs-bremen.de">tviessmann@stud.hs-bremen.de</a>&gt;</span><br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


  
    
  
  <div bgcolor="#ffffff" text="#000000">
    Thank you, Wolfgang! :)<br>
    <br>
    Let&#39;s say:<br>
    I&#39;m generating StatusMessage objects during the rule processing.
    They will be published. But they are also need for further
    processing (so they can not be deleted after publishing).<br>
    The StatusMessage objects defined as simple POJOs.<br>
    <br>
    If I&#39;m publishing the StatusMessage objects using a rule like<br>
        rule &#39;publish StatusMessages&#39;<br>
            when<br>
                $msg : StatusMessage( )<br>
            then<br>
                // publish<br>
        end<br>
    In this case every StatusMessage would be send again and again. <br></div></blockquote><div><br>No, unless //publish modifies/updates $msg. Even if you&#39;d need to change the POJO, you can do so without notifying the Engine.<br>
-W<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div bgcolor="#ffffff" text="#000000">
    My first impression for a solution would be to define a Boolean
    field &#39;send&#39; that signals if the object has been send. But the field
    would just be needed for Drools internal processing. So I thought of
    defining this additional field using the declare statement. But if I
    remember correctly from previous tries, such a things are not
    possible because the declare statement with the additional field is
    the definition of a new type... Am I right so far?<br>
    <br>
    Do you have a idea how I can solve my problem of sending an
    fact/event just once but keep it in the memory for further
    processing?<br>
    <br>
    Thank sou!<br>
    Tina<br>
    <br>
    <br>
    <blockquote type="cite">The usual method:<br>
      You establish a TopicPublisher as a global declared in your .drl
      file.<br>
         global TopicPublisher topicPublisher<br>
      You must set this from Java code using<br>
         TopicPublisher topicPublisher = ...;<br>
         statefulKnowledgeSession.setGlobal( &quot;publisher&quot;, topicPublisher
      )<br>
      and then you use it in any RHS code.<br>
      <br>
      Of course, a TopicPublisher could also be (field of) some fact,<br>
      but this shouldn&#39;t be necessary for such a central service.<br>
      <br>
      -W<br>
      <br>
      <br>
      <div class="gmail_quote">On 29 August 2010 19:16, Tina Vießmann <span dir="ltr">&lt;<a href="mailto:tviessmann@stud.hs-bremen.de" target="_blank">tviessmann@stud.hs-bremen.de</a>&gt;</span>
        wrote:<br>
        <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">  Hi,<br>
          <br>
          I&#39;ve got a simple question.<br>
          <br>
          How can I get generated facts out of the memory (for
          publishing them<br>
          using JMS)?<br>
          <br>
          Thanks :)<br>
          Tina<br>
          _______________________________________________<br>
          rules-users mailing list<br>
          <a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a><br>
          <a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
        </blockquote>
      </div>
      <br>
      <pre><fieldset></fieldset>
_______________________________________________
rules-users mailing list
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
  </div>

<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br></blockquote></div><br>