Those who work in a development environment that cannot directly consume the Selerix .NET library included in the enrollment integration SDK can take advantage of the BenSelect report editor online to generate a customized transmittal XML that shows the structure, elements and attributes required by BenSelect. The report editor offers code completion helpers that show how the Selerix data model relates to a data transmittal and can create a well formed custom Selerix data transmittal XML file for use as a reference:
Because BenSelect reporting exposes personal information on the case, check with your case administrator to verify that your user account includes the permissions for report access. After you obtain the URL to the BenSelect administrator site and the name of the case, you are ready to begin. Note that the case must have at least one active enrollment to generate the sample XML produced by the example report. The data on the case is not actually used here so a test enrollment will suffice as long as the confirmation forms are signed and the test employee's enrollment status is "Complete". Just follow the steps below.
Now that the plugin is configured to output a plain text file, add this JScript.NET code to instantiate a Selerix .NET Transmittal object, set the transmittal properties, and serialize the result to XML:
// This script demonstrates how to use BenSelect report editor helpers as a data dictionary to the Selerix data transmittal. Run the
// report to create an actual, customized Selerix data transmittal XML structure to use as a reference in production environments that
// cannot consume the Selerix .NET library directly. The XML created here is injected into the SOAP or SAML XML message POSTed to BenSelect.
Event.SkipRecord = !Event.LastRecord; // Only execute report definition once on the last record // Only create a transmittal once during report run. Output will be written to a plain text file. if (Event.FirstRecord) { var transmittalObj = new Selerix.BusinessObjects.Transmittal(); transmittalObj.SenderID = Guid.NewGuid(); // Required transmittalObj.Group = new Selerix.BusinessObjects.Group(); // Required transmittalObj.PortfolioID = Guid.NewGuid(); // Required transmittalObj.Type = Selerix.BusinessObjects.TransmittalType.UploadApplicants; // Required // Instantiate a new applicant object for the employee and populate it with data using Intellisense as a data dictionary transmittalObj.Applicants = new Selerix.BusinessObjects.ApplicantCollection(); var applicantObj = new Selerix.BusinessObjects.Applicant(); applicantObj.ID = "13579BD"; // Required. Must be unique to each family being uploaded. applicantObj.EmployeeIdent = "12345"; // or Required. Same as Employee ID from Employee screen, EID in census applicantObj.Relationship = Selerix.BusinessObjects.Relationship.Employee; // Required applicantObj.FirstName = "Wylie"; // Required (First OR Last) if using First + Last + DOB applicantObj.LastName = "Coyote"; // Only first or last name is actually required applicantObj.SSN = "222-33-4444"; // Required if using SSN to identify (then name/dob not required) applicantObj.BirthDate = new DateTime(1980, 1, 15); // Required if using (First OR Last) + DOB // Employment object contains information about employee's workplace. // Note that employment properties below are FREE FORM TEXT (can be any value) as defined in case setup. var employmentObj = new Selerix.BusinessObjects.Employment(null); //employmentObj.HireDate = new DateTime(2012, 1, 1); // Required employmentObj.Location = "JAX"; // Required employmentObj.Department = "Product Development"; // Required employmentObj.JobClass = "Salary"; // Required employmentObj.Title = "Super Genius"; // Add the employment info to the applicant info applicantObj.Employment = employmentObj; // Add the applicant info to the transmittal object transmittalObj.Applicants.Add(applicantObj); // Intellisense in OnRowStart doesn't recognize the Selerix Serialization Helper, but it works. var transmittalXML = Selerix.Foundation.Data.SerializationHelper.SerializeToString(transmittalObj); // Uncomment the line below to create XML that can be embedded in a SOAP or SAML envelope. // The "less than" and "greater than" symbols are converted to their HTML entity equivalents. //transmittalXML = transmittalXML.Replace("<", "<").Replace(">", ">"); // Save the serialized transmittal object to Globals Hashtable for use by report definition script Event.Globals["TransmittalXML"] = transmittalXML; }
Lastly, click the Report Definition tab in the plugin editor and add the code to output the transmittal:
// Report definition is only executed once during the whole report run, on LastRecord. Here
// we effectively dump the contents of the serialized transmittal to the report output by
// accessing the TransMittalXML key of the Globals Hashtable created in the JScript tab. Event.Value = Event.Globals["TransmittalXML"];