Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3873264
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:01:00+00:00 2026-05-19T22:01:00+00:00

In the application that I’m working on right now, I need to periodically check

  • 0

In the application that I’m working on right now, I need to periodically check eligibility of tens of thousands of objects for some kind of a service. The decision diagram itself is in the following form, just way larger: Decision diagram

In each of the end nodes (circles), I need to run an action (change an object’s field, log information etc). I tried using Drool Expert framework, but in that case I’d need to write a long rule for every path in the diagram leading to an end node. Drools Flow doesn’t seem to be built for such a use case either – I take an object and then, depending on the decisions along the way, I end up in one of the end nodes; and then again for another object. Or is it? Could you give me some examples/links to such solutions?

UPDATE:

Drools Flow calls might look like this:

// load up the knowledge base
KnowledgeBase kbase = readKnowledgeBase();
StatefulKnowledgeSession ksession = kbase.newStatefulKnowledgeSession();
Map<String, Object> params = new HashMap<String, Object>();

for(int i = 0; i < 10000; i++) {

    Application app = somehowGetAppById(i);

    // insert app into working memory
    FactHandle appHandle = ksession.insert(app);

    // app variable for action nodes
    params.put("app", app);

    // start a new process instance
    ProcessInstance instance = ksession.startProcess("com.sample.ruleflow", params);
    while(true) {
        if(instance.getState() == instance.STATE_COMPLETED) {
            break;
        }
    }

  // remove object from working memory
    ksession.retract(appHandle);
}

That is: I’d take an Application object, start a new process for it, when the process is finished (the final, action node would modify the application somehow), I’d remove the object from working memory and repeat the process for a new App object. What do you think about this solution?

SOLUTION:
I’ve ended up using Drools Flow and it has been working quite fine. My decision process isn’t as straightforward as Drools Expert asks for and depending on where in the decision tree the process is it needs to load lists of objects from the database, transform them, make decisions, log everything etc. I use a Process object that is passed to the process as a parameter and stores all my global variables (for the process) and some convenience methods that are repeated at different points in the tree (as writing Java code in the Script Task nodes isn’t very convenient itself). I also ended up using Java to make decisions (and not mvel or rules) – it’s faster and I’d say easier to control. All objects that I work with are passed as parameters and used as normal Java variables in the code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T22:01:01+00:00Added an answer on May 19, 2026 at 10:01 pm

    Drools expert is definitely the way to go.

    If you want to avoid repeating yourself for the higher nodes, then the trick is to use insertLogical (or just insert if you’re in a stateless session) and to understand that rules can trigger rules (It’s not your father’s SQL query). For example:

    // we just insert Customer objects in the WM
    
    rule "evaluateRetired"
    when
        $c : Customer(age > 65)
    then
        insertLogical(new Retiree($c));
    end
    
    rule "evaluteRetireeIsFemale"
    when
        $r : Retiree(customer.gender == Gender.FEMALE, $c : customer)
    then
        ...
    end
    

    If the decision diagram frequently changes (and you want non-programmers to edit it), take a look at the documentation on decision tables (and DSL). In that case you’ll probably repeat the entire path for each rule, but that’s actually ok in most cases.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The application that I'm working on has a common datepicker format setup. All pages
An application that has been working well for months has stopped picking up the
The application that I'm working on supports 3 languages: English, French and German. How
The application that I help support has no real business objects to speak of,
The application that I am working on has a generic Parent Form called RSChild,
The application that I'm currently working on has a funky set up for the
I found that some application, like GoodReader or Docs to Go, once installed can
I'm writing an application that loads some javascript into a WebBrowser object. To prevent
I have a .NET application that uses an assembly (.dll) that defines some method:
The application that I'm working on is going to be used to create charts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.