Is it possible to get a value from the environment variables defined at local.properties configuration file and access it via the impex file?
Ex.
$someMacro=<some variable from config>
Thank you!
You can add this to your impex:
# Import config properties into impex macros
UPDATE GenericItem[processor=de.hybris.platform.commerceservices.impex.impl.ConfigPropertyImportProcessor];pk[unique=true]
All your configurations from local.properties, etc. are now loaded and can be used via $config-
prefix, say for example:
local.properties
your.config.property=322
So your impex would look something like:
# 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
Hope this works for you.
EDIT: Please also note that if there was no such property found, the value stored on the sample above shall be exactly: $config-your.config.property
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With