Dear support,
thank you for your reply.
ok, this means the order would have to have the status "OPENED" before onStop is getting called?
In this case it might help to wait to issue a context.stop() until no order is in state CREATED anymore?
would it then help to replace context.stop()-calls by the following code?
public void contextStop()
{
boolean bStatusOK = false;
int nLoop = 0;
try
{
while (bStatusOK && nLoop < 5)
{
bStatusOK = true;
for (IOrder order: engine.getOrders())
{
if (order.getState() == IOrder.State.CREATED)
{
bStatusOK = false;
Thread.currentThread();
Thread.sleep(2000,0); //wait 2 seconds and then test again for the state...
break;
}
}
nLoop++;
}
}
catch (Exception e)
{
//...
}
finally
{
context.stop();
}
}
Best, RR.