是否可以从local.properties配置文件中定义的环境变量中获取值并通过impex文件访问它?
防爆.
$someMacro=<some variable from config>
Run Code Online (Sandbox Code Playgroud)
谢谢!
Ats*_*Kai 11
你可以将它添加到你的impex:
# Import config properties into impex macros
UPDATE GenericItem[processor=de.hybris.platform.commerceservices.impex.impl.ConfigPropertyImportProcessor];pk[unique=true]
Run Code Online (Sandbox Code Playgroud)
现在加载了local.properties等的所有配置,可以通过$config-前缀使用,例如:
local.properties
your.config.property=322
Run Code Online (Sandbox Code Playgroud)
所以你的impex看起来像:
# Import config properties into impex macros
UPDATE GenericItem[processor=de.hybris.platform.commerceservices.impex.impl.ConfigPropertyImportProcessor];pk[unique=true]
$variable=$config-your.config.property
INSERT_UPDATE SampleItem;code[unique=true];name
;sample1;$variable
# OR you can just directly use the config macro
INSERT_UPDATE SampleItem;code[unique=true];name
;sample1;$config-your.config.property
Run Code Online (Sandbox Code Playgroud)
希望这对你有用.
编辑:还请注意,如果没有找到这样的属性,上面样本中存储的值应该是:$config-your.config.property.
| 归档时间: |
|
| 查看次数: |
2416 次 |
| 最近记录: |