search cancel

INV-0001: The Investment ID must be unique error converting an object to project

book

Article ID: 254036

calendar_today

Updated On:

Products

Clarity PPM On Premise

Issue/Introduction

We have got a Clarity mapping done to convert an OtherWork instance to Project.

When running the process that uses the mappings to convert an other work instance to a project the process errors out with the following error:

INV-0001: The Investment ID must be unique

Looking at the logs we see the following error:

ERROR 2022-11-09 11:49:34,163 [Action Execution Pipeline 0 (tenant=clarity)] utilities.BpmErrors (clarity:process_admin:10105019__8AAC9999-159B-4A7C-BE06-F95141C054C7:none) BpmErrors::getExceptionTrace(String arg) => 
com.niku.union.odf.exception.ODFValidationException: INV-0001: The Investment ID must be unique.
 at com.niku.odf.object.Utils.execService(Utils.java:234)
 at com.niku.odf.object.Utils.execService(Utils.java:292)
 at com.niku.odf.object.ODFObjectImpl.insert(ODFObjectImpl.java:3066)
 at com.niku.odf.object.ODFObjectImpl.insertWrapper(ODFObjectImpl.java:3141)
 at com.niku.odf.object.ODFAbstractObjectImpl.update(ODFAbstractObjectImpl.java:4496)
 at com.niku.odf.object.ObjectInstanceImpl.update(ObjectInstanceImpl.java:2790)
 at com.niku.odf.object.copyengine.CopyEngine.copyObject(CopyEngine.java:450)
 at com.niku.odf.object.copyengine.CopyEngine.copy(CopyEngine.java:352)
 at com.niku.odf.object.copyengine.CopyEngine.copy(CopyEngine.java:224)
 at com.niku.odf.object.copyengine.CopyEngine.copy(CopyEngine.java:249)
 at com.niku.bpm.services.oi.odf.BpmOperationImpl.convertObject(BpmOperationImpl.java:589)
 at com.niku.bpm.services.oi.odf.BpmOperationImpl.executeSpecialOperation(BpmOperationImpl.java:344)
 at com.niku.bpm.services.oi.odf.BpmOperationImpl.execute(BpmOperationImpl.java:476)
 at com.niku.bpm.services.ExecuteSystemAction.execute(ExecuteSystemAction.java:128)
 at com.niku.bpm.services.ProcessEngine.executeStepAction(ProcessEngine.java:150)
 at com.niku.bpm.engine.rules.ActionExecutionPipeline.processActions(ActionExecutionPipeline.java:141)
 at com.niku.bpm.engine.rules.ActionExecutionPipeline.execute(ActionExecutionPipeline.java:71)
 at com.niku.bpm.engine.rules.Pipeline.run(Pipeline.java:280)

Cause

The investment ID must be unique and the mapping code was violating its uniqueness

Resolution

Update the mappings to exclude the unique_name column

Please see additional notes for the mappings

Additional Information

The code of the mapping done:

<NikuDataBus xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/nikuxog_objectMapping.xsd">
 <Header action="write" externalSource="NIKU" objectType="objectMapping" version="16.0.2.861"/>
<objectMappings>
<objectMapping mappingCode="aMapOth" srcObjectCode="other" destObjectCode="project">
<nls description="Map From Other to Project" languageCode="de" name="aMap"/>
<nls description="Map Attributes From an other to a project Object" languageCode="en" name="Map Attributes from an Other to a project Object"/>
<nls description="Map From Other to Project" languageCode="es" name="aMap"/>
<nls description="Map From Other to Project" languageCode="fr" name="aMap"/>
<nls description="Map From Other to Project" languageCode="ja" name="aMap"/>
<nls description="Map From Other to Project" languageCode="nl" name="aMap"/>
<attributeMappings>
<attributeMapping srcAttributeCode="name" destAttributeCode="name"/>
<attributeMapping destAttributeCode="description" srcAttributeCode="description"/>
<attributeMapping srcAttributeCode="currency_code" destAttributeCode="currency_code"/>
<attributeMapping srcAttributeCode="schedule_start" destAttributeCode="budget_cst_start"/>
<attributeMapping srcAttributeCode="schedule_finish" destAttributeCode="budget_cst_finish"/>
<attributeMapping srcAttributeCode="schedule_start" destAttributeCode="schedule_start"/>
<attributeMapping srcAttributeCode="schedule_finish" destAttributeCode="schedule_finish"/>
<attributeMapping destAttributeCode="MANAGER_ID" srcAttributeCode="MANAGER_ID"/>
<attributeMapping destAttributeCode="arb_line_manager" srcAttributeCode="arb_line_manager"/>
<attributeMapping destAttributeCode="obj_stakeholder1" srcAttributeCode="obj_stakeholder1"/>
<attributeMapping destAttributeCode="arb_bus_requester" srcAttributeCode="arb_bus_requester"/>
<attributeMapping destAttributeCode="arb_itcap" srcAttributeCode="arb_budget_id"/>
<attributeMapping destAttributeCode="unique_code" srcAttributeCode="unique_code"/>
<attributeMapping destAttributeCode="department_code" srcAttributeCode="department_code"/>
</attributeMappings>
</objectMapping>
</objectMappings>
</NikuDataBus>