000030602 - Configure a database query transporter data feed with a multi-select values list for RSA Archer 6.x

Document created by RSA Customer Support Employee on Jun 14, 2016Last modified by RSA Customer Support on Sep 18, 2019
Version 6Show Document
  • View in full screen mode

Article Content

Article Number000030602
Applies ToRSA Product Set: Archer
RSA Version/Condition: 6.x
IssueThis article explains how to configure a database query transporter data feed.
ResolutionThere are two ways to import multiple values into a values list field with a database query data feed:

Method 1.  Create separate rows in the source database for each values list value. 


If you have a values list field called Color and you want to import the three values Red, Blue and Green for one record, your database would need three rows. Each would have the same value for the application's key field, with different values for the Color field.  For example,
 
Key Field Color
12345Red
12345Blue
12345Green


In the data feed configuration, on the Data Map tab, configure the values list with the setting Append data to list-based fields.
 
Field Option "Append Data to List-Based Field"



When the first row is processed, the record 12345 will be added, with the value Red in the values list field.

When the second row is processed, record 12345 will be updated and Blue will be appended to the existing value in the field.

Processing of the third row will again update the record and add the last value to the end of the list.


Method 2.  Add a customized XML transform to the data feed. 


As an alternative to the above, you can add a custom transform to the data feed (on the Navigation tab) to modify the structure of the source XML data.  An example is shown below.  In this transform, you would replace the string FIELDNAME with the actual name of your values list field.
 
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns="http://www.archer-tech.com/">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="NewDataSet">
<ArcherRecords>
  <xsl:apply-templates select="Table"/>
</ArcherRecords>
</xsl:template>
<xsl:template match="*">
<xsl:element name="{local-name()}">
  <xsl:copy-of select="@*"/>
  <xsl:apply-templates/>
</xsl:element>
</xsl:template>
<xsl:template match="NewDataSet/Table/FIELDNAME">
  <xsl:call-template name="outputValues">
      <xsl:with-param name="ename" select="local-name()"/>
    <xsl:with-param name="list" select="."/>
    <xsl:with-param name="del">;</xsl:with-param>
  </xsl:call-template>
</xsl:template>
<xsl:template name="outputValues">
<xsl:param name="list"/>
<xsl:param name="del"/>
<xsl:param name="ename"/>
<!-- GET EVERYTHING IN FRONT OF THE FIRST DELIMETER -->
<xsl:variable name="first" select="substring-before($list,$del)"></xsl:variable>
<!-- STORE ANYTHING LEFT IN ANOTHER VARIABLE -->
<xsl:variable name="remaining" select="substring-after($list,$del)"></xsl:variable>
<xsl:choose>
  <xsl:when test="$first != ''">
      <xsl:element name="{$ename}">
      <item>
            <xsl:value-of select="$first"/>
      </item>
      </xsl:element>
    <!-- CHECK TO SEE IF ANYTHING IS LEFT -->
    <xsl:if test="$remaining">
    <!-- CALL THE TEMPLATE AGAIN USING THE NEW VARIABLEFOR THE PARAMETER -->
    <xsl:call-template name="outputValues">
      <xsl:with-param name="list" select="$remaining"></xsl:with-param>
      <xsl:with-param name="del">;</xsl:with-param>
        <xsl:with-param name="ename" select="$ename"></xsl:with-param>
    </xsl:call-template>
    </xsl:if>
  </xsl:when>
  <xsl:otherwise>
      <xsl:element name="{$ename}">
      <item>
            <xsl:value-of select="$list"/>
      </item>
      </xsl:element>
  </xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

Outcomes