Exemplo n.º 1
0
        public bool IsValidDev2Task()
        {
            if (null == Actions || Actions.Count == 0)
            {
                return(false);
            }
            if (Actions.First().ActionType != TaskActionType.Execute)
            {
                return(false);
            }
            IExecAction action = _taskServiceConvertorFactory.CreateExecAction(Actions.First());

            if (action.Arguments != null)
            {
                List <string> output =
                    action.Arguments.Split('"').Where(a => !String.IsNullOrEmpty(a.Trim())).ToList();
                if (output.Count() != 2 || !output.All(a => a.Contains(":")))
                {
                    return(false);
                }
            }


            if (!action.Path.Contains(GlobalConstants.SchedulerAgentPath))
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        private ITrigger GetTriggerFromXml(string nativeXml)
        {
            _factory = _factory ?? new TaskServiceConvertorFactory();
            _service = _service ?? new Dev2TaskService(_factory);
            using (var task = _service.NewTask())
            {
                task.AddAction(_factory.CreateExecAction("notepad"));

                task.XmlText = nativeXml;
                return task.Triggers.FirstOrDefault();
            }
        }
Exemplo n.º 3
0
 private string SetXmlFromTrigger(ITrigger value)
 {
     _factory= _factory ?? new TaskServiceConvertorFactory();
    _service= _service ?? new Dev2TaskService(_factory);
     using (var task = _service.NewTask())
     {
         task.AddAction(_factory.CreateExecAction("notepad"));
         task.AddTrigger(value);
       
         return task.XmlText;
     }
 }
Exemplo n.º 4
0
        ITrigger GetTriggerFromXml(string nativeXml)
        {
            _factory = _factory ?? new TaskServiceConvertorFactory();
            _service = _service ?? new Dev2TaskService(_factory);
            using (var task = _service.NewTask())
            {
                task.AddAction(_factory.CreateExecAction("notepad"));

                task.XmlText = nativeXml;
                return(task.Triggers.FirstOrDefault());
            }
        }
Exemplo n.º 5
0
        string SetXmlFromTrigger(ITrigger value)
        {
            _factory = _factory ?? new TaskServiceConvertorFactory();
            _service = _service ?? new Dev2TaskService(_factory);
            using (var task = _service.NewTask())
            {
                task.AddAction(_factory.CreateExecAction("notepad"));
                task.AddTrigger(value);

                return(task.XmlText);
            }
        }