Reputation: 21
I have a queue block where agents enter and exit. Each agent has the following attributes (parameters): ID, processing time and due date. After one hour, I want to use an event block to collect the info (ID,processing time and due date) of the agents that are still waiting in the queue at that moment, and write this info to Excel. In Excel, I would like 3 columns, one with the ID's, one with the processing times and one with the due dates of each order in the queue.
I have tried adding and removing info to a LinkedList, but this did not work. Does anyone know how I could get the information I need?
Upvotes: 0
Views: 155
Reputation: 12793
In your event, simply loop across all agents in the queue and write a dbase query to insert data for them using the insertInto
syntax.
Could look like this:
for (int i=0; i<queue.size(); i++) {
MyAgent currentAgent = queue.get(i);
insertInto(myDbaseTable)
.columns(myDbaseTable.column1, myDbaseTable.column2)
.values(currentAgent.someInfo, currentAgent.otherInfo)
.execute();
}
Upvotes: 1