Thanks sberg for your patch, my remarks :
UtilValidate.is[Not]Empty
are useless :
- 'if (UtilValidate.isNotEmpty(parameters.metaDescription)) {' == 'if (parameters.metaDescription) {'
- 'if (UtilValidate.isEmpty(updateProductPromoContentMap.thruDate)) {' == 'if (!updateProductPromoContentMap.thruDate) {'
Map updateContent = parameters
run service:"updateContent", with: updateContent
- You can write directly 'run service:"updateContent", with: parameters'
.where([dataResourceId: productContent.dataResourceId])
- [ ] are useless you can also do : .where(dataResourceId: productContent.dataResourceId)
productContents = from("ProductContentAndInfo").where([productId: parameters.productId, productContentTypeId: "PAGE_TITLE"]).queryList()
if (UtilValidate.isNotEmpty(productContents)) {
GenericValue productContent = productContents.get(0)
You can replace by a direct GenericValue resolution :
GenericValue productContent = from("ProductContentAndInfo").where(productId: parameters.productId, productContentTypeId: "PAGE_TITLE").queryFirst()
if (productContent) { ...
Thanks sberg for your patch, my remarks :
are useless :
Map updateContent = parameters run service:"updateContent", with: updateContent
You can replace by a direct GenericValue resolution :