Пример #1
0
        public bool CheckActivityforTaskName(string iicSessionId, string iActivityName)
        {
            HttpGetRequest getRequest = new HttpGetRequest(this.ICUri + this.IChttppath, "");

            getRequest.QueryStringParams.Add("details", "false");
            getRequest.Headers.Add("icSessionId", iicSessionId);

            string contentOut;

            if (WebInvoker.Invoke(getRequest, out contentOut))
            {
                if (contentOut != "")
                {
                    XmlDocument doc = new XmlDocument();
                    doc.LoadXml(contentOut);
                    int i = 0;
                    // Load each node and check against the task name.
                    // when found exit? or Save Values.?
                    foreach (XmlNode node in doc.DocumentElement.ChildNodes)
                    {
                        i++;
                        activityMonitoryEntry a = activityMonitoryEntry.Deserialize(node.OuterXml);
                        if (a.taskName == iActivityName)
                        {
                            // Get the run ID
                            this.id = a.id;
                            return(true);
                        }
                    }
                }
            }
            return(false);
        }
Пример #2
0
        public bool Schedule(string iicSessionId, string iTaskId, string iTaskType)
        {
            this.icSessionId = iicSessionId;
            this.TaskID      = iTaskId;
            this.TaskType    = iTaskType;

            HttpPostRequest request = new HttpPostRequest(this.ICUri + this.ICHttpPath, this.postData);

            request.Headers.Add("icSessionId", this.icSessionId);

            string contentOut;

            if (WebInvoker.Invoke(request, out contentOut))
            {
                if (contentOut == "")
                {
                    return(true);
                }
                else
                {
                    error e = error.Deserialize(contentOut);
                    Console.WriteLine(e.description);
                    //Select the cd node with the matching title
                    return(false);
                }
            }
            else
            {
                return(false);
            }
        }
Пример #3
0
        public bool LogIn()
        {
            string          contentOut;
            HttpPostRequest request = new HttpPostRequest(this.ICUri + this.ICHttpPath, this.postData);

            if (WebInvoker.Invoke(request, out contentOut))
            {
                // Using the user class to get connection data, can be extended to get
                // other values related to this user connection.

                user u = user.Deserialize(contentOut);
                this.icSessionId = u.icSessionId;
                this.updateTime  = u.updateTime;
                return(true);
            }
            ;

            return(false);
        }
Пример #4
0
        public bool CheckActivityforTaskName(string iicSessionId, string iActivityName)
        {
            HttpGetRequest getRequest = new HttpGetRequest(this.ICUri + this.IChttppath, "");

            getRequest.QueryStringParams.Add("rowLimit", "50");
            getRequest.Headers.Add("icSessionId", iicSessionId);

            string contentOut;

            if (WebInvoker.Invoke(getRequest, out contentOut))
            {
                if (contentOut == "")
                {
                    return(false);
                }
                else
                {
                    XmlDocument doc = new XmlDocument();
                    doc.LoadXml(contentOut);
                    int i = 0;
                    // Load each node and check against the task name.
                    // when found exit? or Save Values.?
                    foreach (XmlNode node in doc.DocumentElement.ChildNodes)
                    {
                        i++;
                        activityLogEntry a = activityLogEntry.Deserialize(node.OuterXml);
                        if (a.objectName == iActivityName)
                        {
                            // Do something
                            this.errorMsg    = a.errorMsg;
                            this.endTime     = (DateTime)a.endTime;
                            this.startTime   = (DateTime)a.startTime;
                            this.state       = a.state;
                            this.successRows = a.successTargetRows;
                            this.failedRows  = a.failedTargetRows;


                            //  Whether the task completed successfully. Returns one of the following codes:
                            //- 1. The task completed successfully
                            //- 2. The task completed with errors.
                            //- 3. The task failed to complete.

                            switch (this.state)
                            {
                            case 1:
                                this.stateString = "Success";
                                break;

                            case 2:
                                this.stateString = "With Errors";
                                break;

                            case 3:
                                this.stateString = "Failed";
                                break;

                            default:
                                this.stateString = "No translated " + this.state;
                                break;
                            }

                            return(true);
                        }
                    }


                    return(true);
                }
            }
            else
            {
                return(false);
            }



            //return false;
        }