MacFurax:

Visiting cpan and searching for "rules processing" turned up FSA::Rules which appears like it might be a good tool for your purpose. From what I've heard, POE sounds like a good tool for event-driven systems like you want. Finally, the Prolog language was created to handle those sorts of problems, so you may want to check out AI::Prolog.

I've never used any of the three, though, so you may want to do some more digging.

I *have* created several workflow systems, and their structure is pretty simple, though. Basically you have a list of queues, and a list of rules for each queue. Periodically, your application wakes up and evaluates the rules for each queue. Each rule scans a set of input queues, and for each item that matches the rule, you move the item to the specified queue. Then, of course, you have all the frills, bells and whistles to turn it into an application.

Toy example:

Queues: Q1: "START": Initial bucket for all applications. Q2: "Incomplete": Applications still needing information wait here. Q3: "Complete": Applications ready to process wait here. Q4: "Credit Approval": Applications needing credit approval wait he +re. Q5: "Fulfillment": Tasks awaiting fulfillment wait here. Q6: "DONE": Completed tasks sit here until deleted/archived/etc. Rules: R1: "?Form completed?" Input queues (Q1) Move item to Q2 if missing any of: (Name, Phone, Address, Product Selected) R2: "?Big order?" Input queues (Q3) Move item to Q4 if value_of(Product Selected) > $500 R3: "?Form completed?" Input queues (Q1, Q2) Move item to Q3 unless missing any of: (Name, Phone, Address, Product Selected) R4: "?Approved?" Input queues (Q4) Move item to Q5 if approved R5: "?Rejected?" Input queues (Q4) Move item to Q6 if !approved ... etc. ...

...roboticus


In reply to Re: rules : action processing like firewall by roboticus
in thread rules : action processing like firewall by MacFurax

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.