Thanks for the idea Norm, this sounds very interesting. Kinda like a linked node setup. I just need to think about how to start coding this. I've asked for help on the other forum too.
Type: Posts; User: alfa86
Thanks for the idea Norm, this sounds very interesting. Kinda like a linked node setup. I just need to think about how to start coding this. I've asked for help on the other forum too.
The solution for my example is 6,8,3,2
This is an algorithm problem, i have posted on coderanch.
Norm, yes I understand the position of the record needs to be used as opposed to the employee value. Given this example;
// 8,3,6,2
// rules in no particular order
// rule1: move 8 after...
I think I've just done a full round and back to square one.
I can't seem to think of a way to sort a list of rules the way that would give me the output.
if I iterate around the rules, i can...
it was too simple.
the original list can be of any order, e.g 8,3,6,2 so ordering descending on the "after" value wont really work. Think I am stuck on the design of this.
Logically though, is it enough to look at the run after value and sort that descending simply?
for e.g if we take the following rules (note that I have created a very simplistic rule class for...
You're right, I've been playing around with this in my head. The rules can be sorted to achieve the final output order.
If the rules are set like this initially:
...
Hey Norm, apologies for the lack of clarity - answers below
--- Update ---
I thought I would have a crack at coding it, but you see my problem.
Agree that for all processAfter's that have the same target, processing them in "last in first out" order makes sense.
On your other questions:
when do you get the list of employees <-- they...
Assumption is that if we have the above scenario where two processAfter occur on the same target, then the first call to the target should take precedence
one.processAfterEmployeeId(four); would...
Hi Nord - yes you're right about the comments.
In terms of your comment:
"That implies the that the order of the calls to the processAfter method needs to be ordered.
For this example: move...
The initial order comes from an external source that I have no control over. The order is initially defined by that system. This process is a bespoke way to customly adjust the order of the list.
...
Hi guys, I am needed some help with a snippet to order a list properly. I have actually turned my use case into a simple employee class for the sake of explaining my issue to everyone.
In the...
Hey guys,
I am new to this forum. I work as a embedded developer on an energy and risk management system. We use Java, but we are limited to the API that the software provides so learning the core...