• Post Reply Bookmark Topic Watch Topic
  • New Topic

Assigning Cases by Iterating through the List  RSS feed

 
Luke Zechariah
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I want to assign Cases to a list of Adjudicators. I have three lists:

Cases List
Adjudicators List
Empty list to which assigned cases would be added. This list would be used at other places in the program.

Requirements: Each CaseClaim list is assigned to each Adjudicator.   Each CaseClaim list can contain one claim or multiple claims for the same person.
Scenario 1:
If there are 7 CaseClaims and 3 adjudicators
First caseClaim list will be assigned to the first adjudicator
Second caseClaim list will be assigned to the Second adjudicator
Third caseClaim list will be assigned to the third adjudicator

Now the Fourth caseClaim list will be assigned to the first adjudicator
Fifth caseClaim list will be assigned to the Second adjudicator
Sixth caseClaim list will be assigned to the third adjudicator

Seventh caseClaim list will be assigned to the first adjudicator

Scenario 2:
If there are 2 CaseClaims and 5 adjudicators
First caseClaim list will be assigned to the first adjudicator
Second caseClaim list will be assigned to the Second adjudicator


Here is the code:



Thank you.
 
Norm Radder
Rancher
Posts: 2240
28
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have any specific java programming questions?
 
Luke Zechariah
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am asking if it could be coded using Hashmap or any such way to fix my problem.
 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If there are always only 3 lists, there wouldn't be a need to use a Map. 
 
Paul Clapham
Sheriff
Posts: 22844
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Luke Zechariah wrote:I am asking if it could be coded using Hashmap or any such way to fix my problem.


But we don't know what your problem is. All we have is a set of requirements and some code with no indication of what parts of those things you're asking about.
 
Luke Zechariah
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Thanks Norm and Paul for your replies.

Ok sure my problem is when I am assigning the workload let's say the first caseClaim, it iterates through the list of examiners and assigns them to the last one. But I want to assign it to the first examiner and break. I could add a break statement in the inside for-loop.

But then when the second caseClaim comes again it gets assigned to the first examiner and breaks instead of the second one. Is there a way to fix this.

Here is DTO for CaseClaim



Here is the DTO for Examiners
 
Norm Radder
Rancher
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to define the rules for assigning a caseClaim to an examiner.
Don't try writing any more code until you have decided.
 
Paul Clapham
Sheriff
Posts: 22844
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to me that according to your rules:

Let's suppose there are three adjudicators, call them 0, 1, and 2. And let's suppose you have cases 0, 1, 2, and so on.

Then adjudicator 0 gets cases 0, 3, 6, 9, and so on. Adjudicator 1 gets cases 1, 4, 7, 10, and so on. Adjudicator 2 gets... well, I'll leave that as an exercise. Seems to me that you should be able to build a solution from that. And if the number of adjudicators changes, the solution should change in a simple, programmable, way.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!