Hi there

I'm new to Genesys and I'm stuck with the setNotReady method for my agent...
I'm trying to set my agent on a state where he can't receive calls but I'm having this error :
[code]2018-05-14 14:02:34,696 - - - - - - - message from SetNotReady'EventError' (52) attributes:
AttributeReferenceID [int] = 6
AttributeThisQueue [str] = "Files_AGE"
AttributeClientID [int] = 586
AttributeThisDN [str] = "938001"
AttributeErrorCode [int] = 185
AttributeErrorMessage [str] = "Set is in wrong state for invocation"
AttributeAgentWorkMode [int] = 3 [AfterCallWork]
AttributeEventSequenceNumber [long] = 30263
TimeStamp:
AttributeTimeinSecs [int] = 1526299353
AttributeTimeinuSecs [int] = 936000
[/code]
Here is my method :
[code]
public void setNotReady(String dn, String queue) {
RequestAgentNotReady request = RequestAgentNotReady.create(dn, AgentWorkMode.AfterCallWork,
queue, null, null);
try {
tServerProtocol.requestAsync(request, this, new CompletionHandler<Message, Object>() {
public void completed(Message message, Object obj) {
logger.info("AgentProcessor -> setNotReady() -> dn " + dn + " OK");
logger.info("message from SetNotReady" + message);
if (EventAgentNotReady.ID == message.messageId())
agent.setReady(false);
else
logger.info("AgentProcessor -> setNotReady() -> EventAgentNotReady: "
+ EventAgentNotReady.ID
+ " vs "
+ message.messageId());
}
public void failed(Throwable arg0, Object obj) {
logger.error("AgentProcessor -> setNotReady() failed -> dn " + dn, arg0);
}
});
} catch (Throwable e) {
logger.error("AgentProcessor -> setNotReady() -> dn " + dn + " FAILED", e);
}
}
[/code]
Is there a simple way to set an agent in this state ?

I've searched the forum but I didn't find my answer.
Thank you !