public void EnqueueItemOnIdle(IComparable queueName, Object item, IPendingWork pendingWork, Object workItem) { using (new WorkflowTraceTransfer(this.InstanceId)) { while (true) { WorkflowExecutor executor = _runtime.Load(this); if (executor.IsInstanceValid) { try { executor.EnqueueItemOnIdle(queueName, item, pendingWork, workItem); break; } catch (InvalidOperationException) { if (executor.IsInstanceValid) { throw; } } } } } }