Selerix Developer Tools
Build Custom Transmittal XML Samples With BenSelect Reporting
Supplemental Information > The Selerix Data Transmittal > The Selerix Transmittal Simplified > Build Custom Transmittal XML Samples With BenSelect Reporting

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.

 

Add a new plugin

  1. Log in to the BenSelect administrator site using the user name and password provided by your case administrator and select the case from the drop down list at the top right.
  2. From the main menu, select Case Setup > Plug-Ins.
  3. Click New to create a new report plugin.
  4. The most versatile report template in the system is the BenefitAgent Employer Extract, so search for the word employer.
  5. Select the BenefitAgent Employer Extract in the results list and click Copy.
  6. The system takes you to the General tab of the plugin template.  Change the Template Name to something you will remember later in case you want to refer to it again.  At the bottom of the page click Save.
  7. Click the Options tab to access the options page.
  8. Change the value for Column headings in 1st row to No Column Row.
  9. Change File Format to TXT.
  10. At the bottom of the page, click Save

Write the code

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:

  1. Click the JScript tab to access report events.
  2. Click the icon to the right of OnRowStart to open the JScript editor.
  3. Paste the sample code below into the editor then click Save at the bottom of the dialog.
// 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("<", "&lt;").Replace(">", "&gt;");

   // 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:

  1. Click the Report Definition tab to define the output fields.
  2. From the Add Columns dialog, select the first item in the dialog's list which is Blank Field, then click Close.
  3. You should now see a single entry in the grid with a Column Name of Blank Field.  Click the icon to the far right to open the report definition script editor.  Replace the automatically generated code with the following:
// 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"];
  1. Click Save at the bottom of the dialog to save the script.
  2. Click Save and Run at the bottom of the page to run the report.  Leave all options set to their default values but change Scope to Full and run the report to generate the transmittal XML.

 

 

See Also