In my AGV process flow, AGV is waiting in standby point in the beginning, so I use wait for event activity to control. I have a table used to record all tasks for AGVs, I want to check if AGV still has any tasks to do after completing one. I'd like to use a condition like:
int getTaskID = query("SELECT MAX(TaskID)FROM TaskTable WHERE AGVID = tempAGV AND Done = 0");
if(getTaskID>0){
AGV will execute a new task.
}else
stay in standbypoint.
I would like to know which event I should use? The object field is token.agv. I want to fill in the if statement above for the event field. Also, for the if statement, how could I let AGV leave/stay in wait for event activity if that statement is true/false. I think I'd like to use "return", but I still couldn't find a suitable event to use.