/// <summary>
        /// Gets the workflow attributes.
        /// </summary>
        /// <param name="workflowTypeId">The workflow type identifier.</param>
        /// <returns></returns>
        private static List <EntityField> GetWorkflowAttributes(int?workflowTypeId)
        {
            List <EntityField> entityAttributeFields = new List <EntityField>();

            var fakeWorkflow = new Rock.Model.Workflow();

            if (workflowTypeId.HasValue)
            {
                fakeWorkflow.WorkflowTypeId = workflowTypeId.Value;
            }
            else
            {
                //// if no WorkflowTypeId was specified, just set the WorkflowTypeId to 0
                //// NOTE: There could be Workflow Attributes that are not specific to a WorkflowTypeId
                fakeWorkflow.WorkflowTypeId = 0;
            }

            Rock.Attribute.Helper.LoadAttributes(fakeWorkflow);
            var attributeList = fakeWorkflow.Attributes.Select(a => a.Value).ToList();

            EntityHelper.AddEntityFieldsForAttributeList(entityAttributeFields, attributeList);

            int index        = 0;
            var sortedFields = new List <EntityField>();

            foreach (var entityProperty in entityAttributeFields.OrderBy(p => p.TitleWithoutQualifier).ThenBy(p => p.Name))
            {
                entityProperty.Index = index;
                index++;
                sortedFields.Add(entityProperty);
            }

            return(sortedFields);
        }
 /// <summary>
 /// Abstract method for sending a background request. Derived classes should implement
 /// this method to initiate a background request. Because requests will be made through a
 /// workflow, the workflow is passed to this method. It is up to the derived class to
 /// evaluate/update any workflow attributes it needs
 /// </summary>
 /// <param name="rockContext">The rock context.</param>
 /// <param name="workflow">The Workflow initiating the request.</param>
 /// <param name="personAttribute">The person attribute.</param>
 /// <param name="ssnAttribute">The SSN attribute.</param>
 /// <param name="requestTypeAttribute">The request type attribute.</param>
 /// <param name="billingCodeAttribute">The billing code attribute.</param>
 /// <param name="errorMessages">The error messages.</param>
 /// <returns>
 /// True/False value of whether the request was successfully sent or not
 /// </returns>
 public abstract bool SendRequest(RockContext rockContext, Rock.Model.Workflow workflow,
                                  AttributeCache personAttribute, AttributeCache ssnAttribute, AttributeCache requestTypeAttribute,
                                  AttributeCache billingCodeAttribute, out List <string> errorMessages);