XOG In New Custom Instance With Child and Blueprint Does Not Create Child
search cancel

XOG In New Custom Instance With Child and Blueprint Does Not Create Child

book

Article ID: 395135

calendar_today

Updated On:

Products

Clarity PPM On Premise Clarity PPM SaaS

Issue/Introduction

If you specify a Blueprint ID when you are creating a new instance of a custom object that also includes a new child object instance, the child object instance is not created.

Steps to Reproduce:

  1. Create a custom object with a subobject, both API enabled.
  2. Create a new custom object instance with a subobject instance via XOG - you can read an existing one and modify the request to look like:

<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_customObjectInstance.xsd">
    <Header action="write" externalSource="NIKU" objectType="customObjectInstance" version="16.3.1.1473"/>
    <customObjectInstances objectCode="my_custom_object">
        <instance instanceCode="parent_instance" objectCode="my_custom_object">
            <CustomInformation>
                <ColumnValue name="page_layout">odf.my_custom_objectFrame</ColumnValue>
                <ColumnValue name="odf_period_start"/>
                <ColumnValue name="odf_period_end"/>
                <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
                <ColumnValue name="code">parent_instance</ColumnValue>
                <ColumnValue name="name">parent_instance</ColumnValue>
                <instance instanceCode="child_instance" objectCode="my_custom_subobject" parentInstanceCode="parent_instance" parentObjectCode="my_custom_object">
                    <CustomInformation>
                        <ColumnValue name="partition_code">NIKU.ROOT</ColumnValue>
                        <ColumnValue name="name">child_instance</ColumnValue>
                        <ColumnValue name="code">child_instance</ColumnValue>
                    </CustomInformation>
                    <OBSAssocs complete="false"/>
                    <Security>
                        <UserSecurity rightCode="odf_cst_my_custom_subobject_edit" userName="admin"/>
                    </Security>
                </instance>
            </CustomInformation>
            <OBSAssocs complete="false"/>
            <Security>
                <UserSecurity rightCode="odf_cst_my_custom_object_edit" userName="admin"/>
            </Security>
        </instance>
    </customObjectInstances>
</NikuDataBus>

(do NOT include odf_blueprint_id in the parent_instance, nor odf_parent_id/odf_cncrt_parent_id in the child_instance)

Expected and Actual Results: Parent and Child instances are created correctly.

 

  1. Add the following line after the name attribute to set the Blueprint ID (with a correct Blueprint ID) and create a NEW instance like in Step 2:

<ColumnValue name="odf_blueprint_id">5012345</ColumnValue>

Expected Results: Parent and Child instances are created correctly, and Parent instance has the specified Blueprint.

Actual Results: Parent instance is correctly created with the specified Blueprint, but the Child instance is not created.

XOG returns the following warning message:

<ErrorInformation>
  <Severity>WARNING</Severity>
  <Description>java.lang.NullPointerException: Cannot invoke "com.niku.union.odf.ObjectInstance.getData()" because "parentInst" is null</Description>
</ErrorInformation>

Environment

Clarity 16.2.3, 16.3.0, 16.3.1

Cause

DE169710

Resolution

This issue has been fixed in Clarity 16.3.3.

Note: As the same XOG code may be reused in different environments, or used during migrations, the Blueprint ID may exist in both but refer to a different-than-intended Blueprint. As part of the fix and to remind this, a warning message will be returned on a successful XOG: "Provided blueprint id <id> is mapped to the newly created instance. Please make sure it is correct blueprint."

 

Workaround: XOG in the request twice.