0
votes

I would like to use my different dates of my database time arrival in my dynamic event. How get I access to it. To use values or different times isn't a problem but I dont't understand how I can use my different dates from my database in my dynamic event. I have different amounts of pallets which should get released to the certain times of my dbase. For the pallets I use the parameters with the different amounts, the only problem is that I don't know how I can implement the dbase into the dynamic event. For example at 7 am 30 pallets (parameter1) should leave the pallet rack. dbase

1

1 Answers

0
votes

assuming your dynamic event is called MyDynamicEvent, your database is called my_db and your column with the dates is called dates, then on main startup you can do the following:

List< Date > dates=selectFrom(my_db).list(my_db.dates);
for(Date date : dates ) {
    Date today=date();
    long diff = date.getTime() - today.getTime();
    create_MyDynamicEvent(diff,MILLISECOND);
}

This will create all the dynamic events you need based on your database. In your dynamic event you can generate the code necessary to do whatever you want with your pallets