Exemplo n.º 1
0
        /// <summary>
        /// Loads job instance checkpoints.
        /// </summary>
        protected void LoadCheckpoints()
        {
            checkpoints.Clear();

            string sql = "spFindJobInstanceCheckpoint";

            using (SqlCommand cmd = Context.CreateStoredProcedureCommand(sql))
            {
                cmd.Parameters.Add("@UserGuid", SqlDbType.UniqueIdentifier).Value = Context.UserGuid;
                cmd.Parameters.Add("@JobInstanceGuid", SqlDbType.UniqueIdentifier).Value = Guid;

                using (SqlDataReader dr = cmd.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        JobCheckpoint cp = new JobCheckpoint();

                        // 0 index is the job instance guid
                        int o = -1;
                        cp.SequenceNumber = dr.GetInt32(++o);
                        cp.Name = dr.GetString(++o);
                        cp.ExecutionStatus = (JobExecutionState)dr.GetInt32(++o);

                        checkpoints.Add(cp);
                    }
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Queries the workflow class definition for checkpoints.
        /// </summary>
        /// <remarks>
        /// Checkpoints are defined by adding <b>Jhu.Graywulf.Workflow.Activities.CheckpointActivity</b> activities
        /// to the workflow.
        /// The logic is implemented in
        /// the <see cref="Jhu.Graywulf.Workflow.ReflectionHelper"/> class.
        /// </remarks>
        public void DiscoverWorkflowCheckpoints()
        {
            checkpoints.Clear();

            var rh = JobReflectionHelper.CreateInstance(this.workflowTypeName);
            foreach (string name in rh.GetCheckpoints())
            {
                JobCheckpoint cp = new JobCheckpoint();
                cp.Name = name;
                checkpoints.Add(cp);
            }
        }