Beispiel #1
0
        /// <summary>
        /// Returns the sequential workflow in which this activity is hosted.
        /// </summary>
        /// <returns>EdgeSequentialWorkflow class</returns>
        protected BaseSequentialWorkflow GetParentSequentialWorkflow()
        {
            if (_parentWorkflow != null)
            {
                return(_parentWorkflow);
            }

            BaseSequentialWorkflow ret = null;
            CompositeActivity      a   = this.Parent;

            while (a.Parent != null)
            {
                a = a.Parent;
            }

            ret = (BaseSequentialWorkflow)a;
            return(ret);
        }
Beispiel #2
0
        /// <summary>
        /// Returns the value related to a specific condition name.
        /// </summary>
        /// <param name="conditionName">The name of the condition</param>
        /// <returns>The value of the condition (needs to be converted to the "real" type in the condition)</returns>
        public object GetConditionValue(string conditionName)
        {
            BaseSequentialWorkflow esw = GetParentSequentialWorkflow();

            if (esw == null)
            {
                return(null);
            }

            if (esw.ConditionValues.ContainsKey(conditionName))
            {
                return(esw.ConditionValues[conditionName]);
            }
            else
            {
                return(null);
            }
        }
Beispiel #3
0
        public void UpdateStatus(WorkflowStatusCodes statusCode, BaseSequentialWorkflow bsw, DateTime startTime, string resultInfo)
        {
            DataManager.ConnectionString = bsw.ConnectionString;
            using (DataManager.Current.OpenConnection())
            {
                if (resultInfo.Contains("'"))
                {
                    resultInfo = resultInfo.Replace("'", "");
                }

                string sql = @"INSERT INTO AlertEngineHistory (wf_id,start_run_time,end_run_time,result,result_info) 
                                VALUES(" + bsw.WorkflowID.ToString() + ",'" + startTime.ToString("yyyyMMdd HH:mm:ss") + "','" +
                             DateTime.Now.ToString("yyyyMMdd HH:mm:ss") + "'," + Convert.ToInt32(statusCode) +
                             ",'" + resultInfo + "')";

                SqlCommand alertHistory = DataManager.CreateCommand(sql);
                alertHistory.ExecuteNonQuery();
            }
        }