1 Reply Latest reply on Sep 3, 2008 2:39 AM by ohughes

    First Ever Rule to replace long if then else if bock

    ohughes

      Hi all,

      I am looking at creating some rule implementations, and want to start with a nice easy example to replace a simple, but long, if then else if block of statements.

      To put it simply,
      if a="asdf" && b = "qwer" && c = 1 then
      create me a set of objects
      else if a="zxcv" && b = "qwer" && c = 1 then
      create me a different set of objects
      etc. etc.
      and then a final else block if no matches are found.

      How do I map this concept into a drl so that once a rule has matched the required 'when' clause and the required objects are inserted into the WorkingMemory, it doesn't proceed and execute the other rules in the file because they don't need executing as a match has been found?

      Thankyou very much in advance for any advice and help offered on this, as I am new to rules, but am unable to work this simple one out. It probably requires me to think about things differently, but I am unable to find an example which shows me this,

      Thanks again,
      Osian