Thank you for a prompt response!
Yes i get what you are recommending. But there are 2 issues issue,
1. The processing time in my original model is as low as 0.25 sec. so if i add 1/10th of second as the loop delay, then its going to add on to it.
2. I have like at least 6 conditions that need to be satisfied in order to break the loop. The model is just an example, I have this model that has a subflow, so there are around 6 tokens entering the subflow at a time. I cannot share the model, but i would share the code from one of the decide activity.
I apologize. The code got disorganized when I pasted it here
Object current = param(1);
treenode activity = param(2);
Token token = param(3);
treenode processFlow = ownerobject(activity);
Object Station2 = token.Station2;
Object Station3 = token.Station3;
Object Station4 = token.Station4;
Object PrevStation = token.PrevStation;
Object PrevModule = token.PrevModule;
Object PrevMoveout = token.PrevMoveout;
Object FirstHandover = token.FirstHandover;
Object SecondHandover = token.SecondHandover;
if(Table("TerminalCount")[token.Indexx][7] == 1)
{
return 2;
}
else
{
if(token.PAP?)
{
Object PAP = token.PAP;
if((objectexists(PrevMoveout.first) | objectexists(PrevStatio n.first) |
objectexists(FirstHandover.first)) && (PrevModule.color == Col or.silver))
{
if(objectexists(FirstHandover.first))
{
if ((Station2.stats.state().value == 6 && PAP. stats.state().value == 6
&& Station3.stats.state().value == 6 && Statio n4.stats.state().value == 6) &&
!objectexists(SecondHandover.first))
{
return 1;
}
else
{
return 2;
}
}
else
{
return 2;
}
}
else
{
if ((Station2.stats.state().value == 6 && PAP.stats.st ate().value == 6
&& Station3.stats.state().value == 6 && Station4.stat s.state().value == 6) &&
!objectexists(SecondHandover.first))
{
return 1;
}
else
{
return 2;
}
}
}
else // No PAP
{
Object Station1 = token.Station1;
Object Stitcher2 = token.Stitcher2;
if((objectexists(PrevMoveout.first) | objectexists(PrevStatio n.first) |
objectexists(FirstHandover.first)) && (PrevModule.color == Col or.silver))
{
if(objectexists(FirstHandover.first))
{
if ((Station1.stats.state().value == 6 && Stat ion2.stats.state().value == 6
&& Station3.stats.state().value == 6 & & Station4.stats.state().value == 6) &&
!objectexists(SecondHandover.first)
&& (Stitcher2.stats.state().value == 3 | Stitcher2.stats.state().value == 1 |Stitcher2.stats.state().value == 6))
{
return 1;
}
else
{
return 2;
}
}
else
{
return 2;
}
}
else
{
if ((Station1.stats.state().value == 6 && Station2.sta ts.state().value == 6
&& Station3.stats.state().value == 6 && Station4.stat s.state().value == 6) &&
!objectexists(SecondHandover.first)
&& (Stitcher2.stats.state().value == 3 | Stitcher2.sta ts.state().value == 1 |
Stitcher2.stats.state().value == 6))
{
return 1;
}
else
{
return 2;
}
}
}
}
If its clear, all the conditions in the If loops need to be satisfied in order to move the token out of the loop. The code is from Decide8 from the picture below. Connector 1 is going to "to station2/PAP" and connector 1 is going to the delay.

This is the reason I am not sure how to use the wait fro event activity.
I hope this is clear enough!