Custom object properties page break throwing a client side error after the upgrade - API related

book

Article ID: 145574

calendar_today

Updated On:

Products

Clarity PPM SaaS Clarity PPM On Premise

Issue/Introduction

SUMMARY OF DEFECT: 
When upgrading from a version which does not have API enabled to an API enabled PPM version, multiple custom sub objects  having a sinbgle master object will
fail to open from the Administration --> Objects --> Custom sub objects. An API related error will be thrown in the app-ca logs.  


AFFECTED VERSIONS - Clarity PPM 15.7 and above

STEPS TO REPRODUCE:
1. Login to a 15.4 base machine 
2. Navigate to Administration - Objects
3. Create 3 Objects - Apple, Grape, Orange which are sub objects of Investment Objects
4. Create a few custom attributes under the above custom obejcts. 
5. Upgrade the above system to 15.7.1
6. Navigate to Administration - Objects
7. Click on each of the custom sub objects - Orange, Apple and Grape

EXPECTED RESULT: The custom sub objects opens up to its properties page

ACTUAL RESULT: Clicking on the object throws an error - Unable to Process Request - Server or Network Error.


The app-ca logs throw the below error
FATAL 2020-02-12 22:42:35,737 [http-nio-14001-exec-10] web.VXSLServer (clarity:[email protected]:96749491__A36193B6-68D2-42C3-ACF2-2DC6C86419FC:odf.objectProperties) Transformation fatal error:Error in call to extension function {public static java.lang.Boolean com.niku.union.xsl.ApiAliasExt.allowApiAlias(java.lang.String)}: Sequence contains more than one value; Java method expects only one; SystemID: file:/fs0/clarity1/clarity/META-INF/union/vxsl/foundation.xsl; Line#: 1048575; Column#: -1
; SystemID: file:/fs0/clarity1/clarity/META-INF/union/vxsl/foundation.xsl; Line#: 1048575; Column#: -1
net.sf.saxon.trans.DynamicError: Error in call to extension function {public static java.lang.Boolean com.niku.union.xsl.ApiAliasExt.allowApiAlias(java.lang.String)}: Sequence contains more than one value; Java method expects only one
                at net.sf.saxon.functions.ExtensionFunctionCall.iterate(ExtensionFunctionCall.java:114)
                at net.sf.saxon.expr.ComputedExpression.effectiveBooleanValue(ComputedExpression.java:545)
                at net.sf.saxon.expr.BooleanExpression.effectiveBooleanValue(BooleanExpression.java:127)
                at net.sf.saxon.expr.BooleanExpression.effectiveBooleanValue(BooleanExpression.java:124)

Cause

Looks like the input XML document contains more than one /data/parentObject element and that’s why the upgrade in-house did not fail. 
That will blow up the call to the allowApiAlias XSL extension. 

To fix it you can edit the: ${install.dir}/META-INF/odf/vxsl/object/objectDefinitionProperties.xsl and change the call to the allowApiAlias to select the first element:

              <xsl:when test="( ($isNew = 'true' or not(object/@apiAlias) ) and $isSubobject = 'true' and (not(parentObject/@code) or (apialias:allowApiAlias(parentObject[1]/@code))))">
                 <cell id="is_api_enabled" type="checkbox" enterOnce="true">
                    <label value="API Enabled"/>
                    <hint value="Once the value is enabled,  it cannot be disabled."/>
                    <data value="1">
                      <xsl:if test="is_api_enabled/@value = '1' or object/@apiEnabled = 'true'">
                        <xsl:attribute name="selected">true</xsl:attribute>
                      </xsl:if>
                   </data>
                 </cell>
              </xsl:when>

Environment

Release : 15.7.1

Component : CA PPM STUDIO

Resolution

DE53336 - Scoped to be fixed in 15.7.1 Patch 2