XOG: Override Auto-Numbering is giving an error when the flag is set to False - unexpected attribute "overrideAutoNumbering"

Document ID : KB000021528
Last Modified Date : 30/08/2018
Show Technical Document Details
Issue:

XOG: Override Auto-Numbering is giving an error when the flag is set to True or False. The presence of this attribute in the xog file seems to cause the error.

Documentation says that the flag is available for the custom attributes of custom objects. We were expecting it would be available for the ID (code) of a custom object. Anyway, we get the unexpected attribute "overrideAutoNumbering" error when we define this flag in the XOG header.

Note: From the XML Open Gateway Developer Guide (page 65):

Autonumbering and Custom Attributes

The flag overrideAutoNumbering is defined in the XOG header and determines whether source XOG content overrides autonumbering in the target content. The flag is available for the custom attributes of custom objects.

The following rules apply:

  • If the flag is set to TRUE, XOG content from the source is applied to the target.
     
  • If the flag is set to FALSE, the autonumbering scheme defined on the target is applied.
     
  • The flag is specified in the XOG export file.

By default, OverrideAutoNumbering=TRUE.

Steps to Reproduce:

  1. Navigate to Administration > Studio and create a custom object.
     
    • name it Auto-numbering Test, object ID=autonumbering_test
       
  2. Select the ID attribute (Database Column=code) and configure auto-numbering, for example:
     
    • Auto-numbered - checked
       
    • Schemes

      Text=AUTO-

      Numeric Counter:Starting=0001, Counter Length=4,Auto-extent=checked
       
  3. Grant access rights to this object to the admin user and create an object instance
     
  4. XOG out this object instance using the following read request:
    <?xml version="1.0" encoding="UTF-8"?><NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_read.xsd"><Header version="8.0" action="read" objectType="customObjectInstance" externalSource="NIKU"/><CustomObjectInstanceQuery><Filter name="objectCode" criteria="EQUALS">autonumbering_test</Filter></CustomObjectInstanceQuery></NikuDataBus>
  5. Edit the output XOG to XOG in a new instance overriding auto-numbering, for instance:
    <?xml version="1.0" encoding="UTF-8"?><NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd"><Header action="write" externalSource="NIKU" objectType="customObjectInstance" version="13.0.0.7032" /><customObjectInstances objectCode="autonumbering_test"><instance instanceCode="OVER-0001" objectCode="autonumbering_test"><CustomInformation><ColumnValue name="code">OVER-0001</ColumnValue><ColumnValue name="name">Override auto-numbering instance</ColumnValue><ColumnValue name="page_layout">odf.autonumbering_testFrame</ColumnValue><ColumnValue name="partition_code">NIKU.ROOT</ColumnValue></CustomInformation><OBSAssocs complete="false"/><Security/></instance></customObjectInstances></NikuDataBus>  
  6. XOG in.

    Note: the new instance is XOGged in overriding auto-numbering.This result is expected since the documentation says that by default, OverrideAutoNumbering=TRUE.
     
  7. Edit the output XOG again to XOG in a new instance without providing an instance ID and without overriding auto-numbering:
    <?xml version="1.0" encoding="UTF-8"?><NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd"><Header action="write" externalSource="NIKU" objectType="customObjectInstance" overrideAutoNumbering="false" version="13.0.0.7032"/><customObjectInstances objectCode="autonumbering_test"><instance objectCode="autonumbering_test"><CustomInformation><ColumnValue name="name">Auto-numbered instance</ColumnValue><ColumnValue name="page_layout">odf.autonumbering_testFrame</ColumnValue><ColumnValue name="partition_code">NIKU.ROOT</ColumnValue></CustomInformation><OBSAssocs complete="false"/><Security/></instance></customObjectInstances></NikuDataBus>

    Result:
    <?xml version="1.0" encoding="UTF-8"?><XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd"><Object type="customObjectInstance"/><Status elapsedTime="0.0 seconds" state="FAILURE"/><Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="0" updatedRecords="0"/> <ErrorInformation>  <Severity>FATAL</Severity>  <Description>[Error] :0:0: unexpected attribute "overrideAutoNumbering" [Error] :0:0: element "instance" is missing "instanceCode" attribute </Description>  <Exception type="java.lang.Exception"><![CDATA[ java.lang.Exception: Invalid xml data at com.niku.xog.service.ObjectHandler.processRequest(ObjectHandler.java:129) at com.niku.xog.handler.XOGProcessHandler.postProcess(XOGProcessHandler.java:44) at com.niku.xql2.XQLVisitor.postProcess(XQLVisitor.java:1354)
  8. Try again, this time with overrideAutoNumbering as an argument to the header, not an attribute of the header (CLRT-22265):
    <?xml version="1.0" encoding="UTF-8"?><NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd"><Header action="write" externalSource="NIKU" objectType="customObjectInstance" version="13.0.0.7032"><args><arg name="overrideAutoNumbering" value="false"/></args></Header><customObjectInstances objectCode="autonumbering_test"><instance objectCode="autonumbering_test"><CustomInformation><ColumnValue name="name">Override auto-numbering instance</ColumnValue><ColumnValue name="page_layout">odf.autonumbering_testFrame</ColumnValue><ColumnValue name="partition_code">NIKU.ROOT</ColumnValue></CustomInformation><OBSAssocs complete="false"/><Security/></instance></customObjectInstances></NikuDataBus>

    Result:
    <?xml version="1.0" encoding="UTF-8"?><XOGOutput xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/status.xsd"><Object type="unknown"/><Status elapsedTime="0.0 seconds" state="FAILURE"/><Statistics failureRecords="0" insertedRecords="0" totalNumberOfRecords="0" updatedRecords="0"/> <ErrorInformation>  <Severity>FATAL</Severity>  <Description>Exception while processing client request</Description>  <Exception type="com.niku.xog.XOGException"><![CDATA[ com.niku.xog.XOGException: java.lang.NullPointerException at com.niku.xog.util.ObjectRequestContext.<init>(ObjectRequestContext.java:130) at com.niku.xog.handler.XOGProcessHandler.postProcess(XOGProcessHandler.java:43)

Expected Result: Instance is XOGged in and the the autonumbering scheme defined on the target is applied
Actual Result: XOG fails. The attribute "overrideAutoNumbering" is not expected.

 

Cause:
Caused by CLRT-66205, CLRT-22265
Resolution:

Resolved in 13.1

Workaround:
This issue happens when the 'overrideAutoNumbering' attribute is added to the XML XML Open Gateway (XOG) file regardless of setting the value to true or false.

Therefore, do not include this attribute in the XML file. When the attribute is omitted, the default behavior is to evaluate it to 'true'. This means that you have to include the value in the code field so that it can override the AutoNumbering.

 

Additional Information:
Also look at:
kb000019245