public static I_LabViewInterface GetLabViewInterface()
        {
            I_LabViewInterface lvInterface = null;
            string revision = null;
            revision = ConfigurationManager.AppSettings["LabViewVersion"];

            if (revision != null && revision.Length > 2)
            {
                if (revision.Contains("8.2"))
                {
                    lvInterface = new iLabs.LabView.LV82.LabViewInterface();
                }
                else if (revision.Contains("8.6"))
                {
                    lvInterface = new iLabs.LabView.LV86.LabViewInterface();
                }
                else if (revision.Contains("2009"))
                {
                    lvInterface = new iLabs.LabView.LV2009.LabViewInterface();
                }

                else if (revision.Contains("2010"))
                {
                    lvInterface = new iLabs.LabView.LV2010.LabViewInterface();
                }
                else if (revision.Contains("2011"))
                {
                    lvInterface = new iLabs.LabView.LV2011.LabViewInterface();
                }
                else if (revision.Contains("2012"))
                {
                    lvInterface = new iLabs.LabView.LV2012.LabViewInterface();
                }
                else if (revision.Contains("WS"))
                {
                    lvInterface = new iLabs.LabView.LVWS.LabViewInterface();
                }
            }
            else // Default to LV 2009
            {
                lvInterface = new iLabs.LabView.LV2009.LabViewInterface();
            }
            return lvInterface;
        }
        public override LabTask CreateLabTask(LabAppInfo appInfo, Coupon expCoupon, Ticket expTicket)
        {
            long experimentID = -1;
            LabTask task = null;
            string revision = null;
            //Parse experiment payload
            string payload = expTicket.payload;
            XmlQueryDoc expDoc = new XmlQueryDoc(payload);

            string experimentStr = expDoc.Query("ExecuteExperimentPayload/experimentID");
            if ((experimentStr != null) && (experimentStr.Length > 0))
            {
                experimentID = Convert.ToInt64(experimentStr);
            }
            string sbStr = expDoc.Query("ExecuteExperimentPayload/sbGuid");

            // Check to see if an experiment with this ID is already running
            LabDB dbManager = new LabDB();
            LabTask.eStatus status = dbManager.ExperimentStatus(experimentID, sbStr);
            if (status == LabTask.eStatus.NotFound)
            {
                // Check for an existing experiment using the same resources, if found Close it

                //Create the new Task
                if (appInfo.rev == null || appInfo.rev.Length < 2)
                {
                    revision = appInfo.rev;
                }
                else
                {
                    revision = ConfigurationManager.AppSettings["LabViewVersion"];
                }
                if (revision != null && revision.Length > 2)
                {
                    if (revision.Contains("8.2"))
                    {
                        task = new iLabs.LabView.LV82.LabViewInterface().CreateLabTask(appInfo, expCoupon, expTicket);
                    }
                    else if (revision.Contains("8.6"))
                    {
                        task = new iLabs.LabView.LV86.LabViewInterface().CreateLabTask(appInfo, expCoupon, expTicket);
                    }
                    else if (revision.Contains("2009"))
                    {
                        task = new iLabs.LabView.LV2009.LabViewInterface().CreateLabTask(appInfo, expCoupon, expTicket);
                    }

                    else if (revision.Contains("2010"))
                    {
                        task = new iLabs.LabView.LV2010.LabViewInterface().CreateLabTask(appInfo, expCoupon, expTicket);
                    }
                    else if (revision.Contains("2011"))
                    {
                        task = new iLabs.LabView.LV2011.LabViewInterface().CreateLabTask(appInfo, expCoupon, expTicket);
                    }
                    else if (revision.Contains("2012"))
                    {
                        task = new iLabs.LabView.LV2012.LabViewInterface().CreateLabTask(appInfo, expCoupon, expTicket);
                    }
                    else if (revision.Contains("WS"))
                    {
                        task = new iLabs.LabView.LVWS.LabViewInterface().CreateLabTask(appInfo, expCoupon, expTicket);
                    }
                }
                else // Default to LV 2009
                {
                    task = new iLabs.LabView.LV2009.LabViewInterface().CreateLabTask(appInfo, expCoupon, expTicket);
                }

            }
            else
            {
                task =  TaskProcessor.Instance.GetTask(experimentID,expCoupon.issuerGuid);
            }
            return task;
        }