Assigning Cases to Analysts

DMCommunity.org published the April 2025 Challenge “Case Assignment”. Here is an OpenRules solution. First, we created a pure business decision model that defined all feasible case-analyst assignments. However, to find a solution that minimizes the total overqualification, we need to use an optimization engine. As usual with OpenRules, we prefer not just to solve the challenge but to build a working decision service that works for different datasets and is available from any remote cloud. The implementation based on Rule Solver is described below.

Glossary

We started with a glossary that specified our input (blue) and output (red) decision variables:

Beige variables should be internally calculated.

Test Cases

Here are test cases for this business problem.

Analysts:

New Analytical Cases:

Case Complexity Table:

Business Problem:

Rules, Constraints, and Solution Search

We can solve the problem in two steps described in the following top-level table:

First, we need to Determine Possible Assignments using the following decision table with two nested loops over Analysts and New Cases:

This table uses the following 5 decision tables:

We decided to define all problem constraints within the Java class “OptimizationProblem” that extends the standard class JavaSolver:

This class implements the method “define” to define all decision (constrained) variables and the objective:

The method “saveSolution” saves the optimal solution back to the business object “Optimal Assignments”:

We invoke this class from the decision model using the following table:

The standard JavaSolver’s method “minimize” will find the optimal solution. If there are no solutions, it will complain about it.

Execution Results

Now we can execute this decision model as any other OpenRules decision model using “test.bat”. Here are the execution results:

Now we can deploy this decision model as a RESTfull decision service, e.g., as AWS Lambda function with one click on the standard file “deployLambda.bat”. It will produce the following invocation URL: https://trzcc38031.execute-api.us-east-1.amazonaws.com/test/case-assignment.

Now we (and anybody else) may test this service using POSTMAN:

The JSON test for this service was automatically produced by OpenRules from the above Excel-based test tables. If you want to run the service, here is the JSON request:

{
“businessProblem” : {
“analysts” : [ {
“name” : “Tim Smith”,
“focusAreas” : [ “Technology”, “Research”, “Construction” ],
“level” : 10,
“maxAllowableAmountPerCase” : 50000000,
“totalAmountOfCases” : 35000000,
“totalNumberOfCases” : 12,
“maxAllowableAmountForAllCases” : 75000000,
“minCaseComplexity” : 0,
“maxCaseComplexity” : 0
}, {
“name” : “Sue Rogers”,
“focusAreas” : [ “Technology”, “Research” ],
“level” : 5,
“maxAllowableAmountPerCase” : 1000000,
“totalAmountOfCases” : 5000000,
“totalNumberOfCases” : 10,
“maxAllowableAmountForAllCases” : 7000000,
“minCaseComplexity” : 0,
“maxCaseComplexity” : 0
}, {
“name” : “Sam Howard”,
“focusAreas” : [ “Construction”, “Research” ],
“level” : 8,
“maxAllowableAmountPerCase” : 20000000,
“totalAmountOfCases” : 19000000,
“totalNumberOfCases” : 9,
“maxAllowableAmountForAllCases” : 20000000,
“minCaseComplexity” : 0,
“maxCaseComplexity” : 0
}, {
“name” : “Jill Ryan”,
“focusAreas” : [ “Technology”, “Research”, “Construction” ],
“level” : 9,
“maxAllowableAmountPerCase” : 1500000,
“totalAmountOfCases” : 14700000,
“totalNumberOfCases” : 10,
“maxAllowableAmountForAllCases” : 25000000,
“minCaseComplexity” : 0,
“maxCaseComplexity” : 0
}, {
“name” : “Debbie Smith”,
“focusAreas” : [ “Research”, “Technology” ],
“level” : 6,
“maxAllowableAmountPerCase” : 10000000,
“totalAmountOfCases” : 8000000,
“totalNumberOfCases” : 14,
“maxAllowableAmountForAllCases” : 10000000,
“minCaseComplexity” : 0,
“maxCaseComplexity” : 0
}, {
“name” : “Debbie Bowers”,
“focusAreas” : [ “Technology”, “Research” ],
“level” : 7,
“maxAllowableAmountPerCase” : 1000000,
“totalAmountOfCases” : 6000000,
“totalNumberOfCases” : 8,
“maxAllowableAmountForAllCases” : 7500000,
“minCaseComplexity” : 0,
“maxCaseComplexity” : 0
}, {
“name” : “Kevin Jones”,
“focusAreas” : [ “Research”, “Technology” ],
“level” : 4,
“maxAllowableAmountPerCase” : 3000000,
“totalAmountOfCases” : 2800000,
“totalNumberOfCases” : 8,
“maxAllowableAmountForAllCases” : 3000000,
“minCaseComplexity” : 0,
“maxCaseComplexity” : 0
}, {
“name” : “Roger Howland”,
“focusAreas” : [ “Construction”, “Technology” ],
“level” : 2,
“maxAllowableAmountPerCase” : 300000,
“totalAmountOfCases” : 850000,
“totalNumberOfCases” : 7,
“maxAllowableAmountForAllCases” : 1000000,
“minCaseComplexity” : 0,
“maxCaseComplexity” : 0
} ],
“newCases” : [ {
“number” : “112”,
“complexity” : 3,
“type” : “Technology”,
“amount” : 50000
}, {
“number” : “113”,
“complexity” : 1,
“type” : “Technology”,
“amount” : 200000
}, {
“number” : “114”,
“complexity” : 4,
“type” : “Construction”,
“amount” : 1500000
}, {
“number” : “115”,
“complexity” : 4,
“type” : “Research”,
“amount” : 300000
} ],
“caseQualifications” : [ {
“level” : 1,
“minCaseComplexity” : 1,
“maxCaseComplexity” : 2
}, {
“level” : 2,
“minCaseComplexity” : 1,
“maxCaseComplexity” : 2
}, {
“level” : 3,
“minCaseComplexity” : 1,
“maxCaseComplexity” : 2
}, {
“level” : 4,
“minCaseComplexity” : 1,
“maxCaseComplexity” : 3
}, {
“level” : 5,
“minCaseComplexity” : 2,
“maxCaseComplexity” : 3
}, {
“level” : 6,
“minCaseComplexity” : 2,
“maxCaseComplexity” : 4
}, {
“level” : 7,
“minCaseComplexity” : 2,
“maxCaseComplexity” : 4
}, {
“level” : 8,
“minCaseComplexity” : 3,
“maxCaseComplexity” : 4
}, {
“level” : 9,
“minCaseComplexity” : 3,
“maxCaseComplexity” : 5
}, {
“level” : 10,
“minCaseComplexity” : 4,
“maxCaseComplexity” : 5
} ]
}
}

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.