我正在考虑更新OOTB的"关系",只想添加"orderd=true"。
OOTB
\hybris\bin\modules\commerceservicescommerceservices\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>
在我的扩展核心myextncore-items.xml中,我覆盖了OOTB关系
<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>
但出现错误-[ycheckdeployes]没有为关系PoS2WarehouseRel 定义部署
然后我尝试了,更新到一个新的代码名称,添加了一个"部署"元素
<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>
这次获取错误-java.lang.UnsupportedOperationException:PoS2WarehouseRelNew关系中的属性仓库已在仓库中声明
如何定义/更新"pointsOfService"one_answers"仓库"之间的关系?
也许这里的例子有帮助:
https://help.sap.com/viewer/d0224eca81e249cb821f2cdf45a82ace/1905/en-US/bae7ed9732a4423f867114217ae21b46.html
在该示例中,他们重新声明了itemtype一端的Collection属性。但看起来很生气。。。
更新:包含的给定链接relationType
具有有序属性,但xsd文件没有。我还没有尝试过,可能是编译器出错了。
关系没有ordered
属性。集合上存在有序属性。您可以检查模块文件夹中的xxx-item.xml
文件架构item.xsd
。
我也遇到了同样的问题。没有定义任何部署,当我定义时,得到了同样的异常。在我的例子中,这一切都是关于在限定符中更改名称。
在这种情况下,我会将其更改为";posWarehouses"(