Skip to Content

Update OOTB 'relation'

I'm looking at updating an OOTB 'relation', just wanted to add 'ordered=true'.

OOTB

\hybris\bin\modules\commerce-services\commerceservices\resources\commerceservices-items.xml

<relation code="PoS2WarehouseRel" localized="false"
			generate="true" autocreate="true">
<description>This relation determines available warehouses for the point of service.</description>
<deployment table="PoS2WarehouseRel" typecode="6217" />
       <sourceElement qualifier="pointsOfService" type="PointOfService"
				cardinality="many" />
	<targetElement qualifier="warehouses" type="Warehouse"
				cardinality="many" collectiontype="list" />				
</relation>

In my extension core, myextncore-items.xml, I overwrote the OOTB relation,

<!-- Set autocreate="false" and added ordered="true" in the 'targetElement' -->

<relation code="PoS2WarehouseRel" localized="false"
				  generate="true" autocreate="false">
<description>This relation determines available warehouses for the point of service.</description>
<sourceElement qualifier="pointsOfService" type="PointOfService"
						   cardinality="many" />
<targetElement qualifier="warehouses" type="Warehouse"
				cardinality="many" collectiontype="list" ordered="true"/>
</relation><br>

But getting error - [ycheckdeployments] No deployment defined for relation PoS2WarehouseRel

Updated to a new code name, added a 'deployment' element,

<relation code="PoS2WarehouseRelNew" localized="false"
				  generate="true" autocreate="true">
<description>This relation determines available warehouses for the point of service.</description>
	<deployment table="PoS2WarehouseRelNew" typecode="13000" />
	<sourceElement qualifier="pointsOfService" type="PointOfService"
						   cardinality="many" />
	<targetElement qualifier="warehouses" type="Warehouse"
				cardinality="many" collectiontype="list" ordered="true"/>
</relation><br>

This time getting error - java.lang.UnsupportedOperationException: Attribute warehouses from PoS2WarehouseRelNew relation is already declared in Warehouse

How do I define a relation between 'pointsOfService' and 'warehouses' ?

Add a comment
10|10000 characters needed characters exceeded

Related questions

0 Answers

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.