2 Replies Latest reply on Oct 10, 2017 10:14 AM by gustavo1

    Import Error over hierarchical XML from BO Employee

    gustavo1 Apprentice

      When we import a XML over XSLT we get this error:

      Can sombody help? I dont understand, why he awaites lastname and name. The xml and xslt has no first or lastname.

       

       

      [quote]

      <?xml version="1.0" encoding="ISO-8859-1"?>

      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

          <xsl:template match="/">

              <BusinessObjectList xsi:noNamespaceSchemaLocation="HierarchicalObjects-1.0.xsd"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SchemaVersion="1.0">

                  <xsl:apply-templates/>

              </BusinessObjectList>

          </xsl:template>

      <xsl:template match="/Root/Channel/item">

          <BusinessObject Name="Employee">

              <Transaction>UpdateAdd</Transaction>

              <UniqueKeyList>

                  <UniqueKey>

                      <Field Name="AA_BSNR"/>

                      <Field Name="LoginID"/>

                  </UniqueKey>

              </UniqueKeyList>

              <FieldList>

                <Field Name="AA_BSNR">

                  <xsl:value-of select="BSNR"/>

                </Field>

                <Field Name="AA_Praxisname">

                  <xsl:value-of select="Praxisname"/>

                </Field>

                <Field Name="Department">

                  <xsl:text>Praxis</xsl:text>

                </Field>

                <Field Name="AA_Kundentyp">

                  <xsl:text>Praxis</xsl:text>

                </Field>

                <Field Name="LoginID">

                  <xsl:value-of select="BSNR"/>

                </Field>

                <Field Name="IsInternalAuth">

                  <!-- 1 for true and 0 for false -->

                  <xsl:text>no</xsl:text>

                </Field>

                <Field Name="Status">

                  <xsl:if test="Aktiv = '0'">

                    <xsl:text>Terminated</xsl:text>

                  </xsl:if>

                  <xsl:if test="Aktiv = '1'">

                    <xsl:text>Active</xsl:text>

                  </xsl:if>

                  <xsl:if test="Aktiv = ''">

                    <xsl:text>Unknown</xsl:text>

                  </xsl:if>

                </Field>

                <!--  -->

                <Field Name="AA_KVOnlineStatus">

                  <!-- <xsl:value-of select="Onlinestatus"/> -->

                  <xsl:if test="Onlinestatus = '0'">

                    <xsl:text>nicht online</xsl:text>

                  </xsl:if>

                  <xsl:if test="Onlinestatus = '1'">

                    <xsl:text>Smartcard vorhanden</xsl:text>

                  </xsl:if>

                  <xsl:if test="Onlinestatus = '2'">

                    <xsl:text>KV-Safenet vorhanden</xsl:text>

                  </xsl:if>

                  <xsl:if test="Onlinestatus = '3'">

                    <xsl:text>Smartcard und KV-Safenet vorhanden</xsl:text>

                  </xsl:if>

                </Field>

                <!-- -->

                <Field Name="PrimaryPhone">

                  <xsl:variable name="target" select="Telefon"/>

                  <xsl:variable name="target_n" select="translate($target,translate($target,'0123456789',''),'')"/>

                  <xsl:choose>

                    <xsl:when test="substring($target_n,1,1) = '0'">

                      <xsl:value-of select="concat('+49',substring($target_n,2))"/>

                    </xsl:when>

                    <xsl:otherwise>

                    <xsl:value-of select="$target_n"/>

                    </xsl:otherwise>

                  </xsl:choose>

                </Field>

                <Field Name="Phone2">

                  <xsl:variable name="target2" select="Fax"/>

                  <xsl:variable name="target2_n" select="translate($target2,translate($target2,'0123456789',''),'')"/>

                  <xsl:choose>

                    <xsl:when test="substring($target2_n,1,1) = '0'">

                      <xsl:value-of select="concat('+49',substring($target2_n,2))"/>

                    </xsl:when>

                    <xsl:otherwise>

                    <xsl:value-of select="$target2_n"/>

                    </xsl:otherwise>

                  </xsl:choose>

                </Field>

                <Field Name="PrimaryEmail">

                  <xsl:value-of select="Email"/>

                </Field>

                <Field Name="Address1">

                  <xsl:value-of select="Strasse"/>

                </Field>

                <Field Name="Address1City">

                  <xsl:value-of select="Ort"/>

                </Field>

                <Field Name="Address1Zip">

                  <xsl:value-of select="PLZ"/>

                </Field>

                <Field Name="Team">

                  <xsl:text>Praxen</xsl:text>

                </Field>

                <Field Name="OrgUnitLink">

                  <xsl:text>Corporate</xsl:text>

                </Field>

              </FieldList>

          </BusinessObject>

      </xsl:template>

      </xsl:stylesheet>

       

      [/quote]

        • 1. Re: Import Error over hierarchical XML from BO Employee
          Jonathan.Schmidt SupportEmployee

          XML imports must abide by the business rules for their destination object just as if the automation system were a person at a keyboard typing in the information on the workspace using the administrator role.  In this case it appears you require Firstname and Lastname to enter an Employee record.  Since these are not supplied by the import the system rejects the data.

           

          Ideally these fields should be added to your import data.  If that's not possible you can modify the Business rules to allow a record to be saved without these.  If you go the second route I would advise you to limit the exception to the InternalServices account only, that way normal users cannot enter a new record without putting these values in.

          1 of 1 people found this helpful
          • 2. Re: Import Error over hierarchical XML from BO Employee
            gustavo1 Apprentice

            Jonathan.schmidt,

             

            very nice!, this was it. After ive deactivated employee Business rules (required rules) for first and lastname the Import worked.

             

            Big thx to you. very good community here!

             

            Greetz

            Gustavo