public static string GetActivityStatusText(ActivityTrackRecord trackRecord)
 {
     //if last record is of type (UpdateTaskStatus), we will show APEX status icon
     //else show microsft WF status icon
     if (trackRecord.Type == "UpdateTaskStatus")
     {
         return(trackRecord.ApexStatus);
     }
     else
     {
         return(trackRecord.WfStatus.ToString());
     }
 }
        public static int GetIconIndexByStatus(ActivityTrackRecord trackRecord)
        {
            //if last record is of type (UpdateTaskStatus), we will show APEX status icon
            //else show microsft WF status icon
            if (trackRecord.Type == "UpdateTaskStatus")
            {
                switch (trackRecord.ApexStatus)
                {
                case "Completed":
                    return(0);

                case "InProgress":
                case "Ready":
                    return(1);

                case "Failed":
                    return(2);

                case "PastDue":
                    return(4);

                case "MarkedForRerun":
                    return(5);

                default:
                    return(-1);
                }
            }
            else
            {
                switch (trackRecord.WfStatus)
                {
                case ActivityExecutionStatus.Closed:
                    return(0);

                case ActivityExecutionStatus.Executing:
                    return(1);

                case ActivityExecutionStatus.Faulting:
                    return(2);

                default:
                    return(-1);
                }
            }
        }