/// <summary>
        /// Unload the classifier
        /// </summary>
        public void UnloadRule()
        {
            if (m_pipeLine.Output.IsOpen)
            {
                m_propertyBagWriter.EndInput();
                m_pipeLine.Input.Close();

                //wait for the script to finish
                m_pipeLine.Output.WaitHandle.WaitOne();

                if (m_pipeLine.Output.Count > 0)
                {
                    m_eventLog.WriteEntry("Some output available from pipeline after pipeline closed. This is unexpected and may leave some output unprocessed.",
                                          EventLogEntryType.Error);
                }
            }
            else
            {
                if (m_pipeLine.PipelineStateInfo.State == PipelineState.Failed)
                {
                    ThrowNonPropertyBagException("Pipeline failed and closed unexpectedly.", m_pipeLine.PipelineStateInfo.Reason);
                }
                else
                {
                    ThrowNonPropertyBagException("Pipeline exited unexpectedly without failures.", m_pipeLine.PipelineStateInfo.Reason);
                }
            }

            m_pipeLine.Dispose();
            m_pipeLine = null;
            m_runSpace.Close();
            m_runSpace = null;
            Dispose(true);
        }