<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-15"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#ffffff" text="#000000">
    Thank you, Wolfgang! :)<br>
    <br>
    Let's say:<br>
    I'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'm publishing the StatusMessage objects using a rule like<br>
        rule 'publish StatusMessages'<br>
            when<br>
                $msg : StatusMessage( )<br>
            then<br>
                // publish<br>
        end<br>
    In this case every StatusMessage would be send again and again. <br>
    My first impression for a solution would be to define a Boolean
    field 'send' 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
      cite="mid:AANLkTimDskNo5fN5mcTV6G+opofXnkKEQkhpVWSo=ZWT@mail.gmail.com"
      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( "publisher", 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'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 moz-do-not-send="true"
            href="mailto:tviessmann@stud.hs-bremen.de">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'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 moz-do-not-send="true"
            href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
          <a moz-do-not-send="true"
            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 wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>