0
votes

I need to put the "Hold" Initially blocked. and then unblock it when there is an agent in the queue that is connected to the Hold.

I tried 2 ways: Way 1: set it initially blocked using the choice in the properties then I wrote in the "Action":

if(queue.size() > 0 )
{ 
  hold.unblock();
}

but it didnt work. I thought that the function cant change the choice. therefore, I tried to not pick "initially block" and write in the action:

hold.initiallyblocked = true;
if(queue.size() > 0 )
{ 
  hold.unblock();
}

but also it didn`t do anything and the hold was blocked.

moreover, I tried to save the number of the agents in the queue in a varaible using "get connection number" and then use if ( getconnectionnubmer >0 ) unblock it. it didn`t workenter image description here

breifly, I want to tell: if there is an agent in the Queue, unblock the Hold. if the queue is empty, block the hold. and it must be intially blocked

1

1 Answers

0
votes

if your only objective is to unblock the hold when the queue is populated by an agent at least, you should put the code in the on enter of the queue block... obviously if an agent enters the queue it means that the queue is not empty:

hold.unblock();

And also on the on exit section of the queue to block the hold if the queue is empty:

if(self.size()==0)
    hold.block();