on ‎2015 Oct 05 8:55 PM
Hi all,
I have a simple impex that update "active" field of some specific cronjobs, based on job code:
UPDATE CronJob[batchmode=true] ;job(code)[unique=true] ;active;$jobCode ;false
The impex works fine when there are some data to update, otherwise it returns an error:
unresolvable:no existing item found for update
Is there a way to avoid this error message when no data are found for update?
Thanks
Giulio
Request clarification before answering.
Giulio, tricky, but works:
UPDATE User[batchmode=true];uid[unique=true]
#% import de.hybris.platform.core.Registry;
#% import de.hybris.platform.servicelayer.search.FlexibleSearchQuery;
#% import de.hybris.platform.servicelayer.search.SearchResult;
#% import de.hybris.platform.servicelayer.search.FlexibleSearchService;
#%
#% queryString = "SELECT * FROM {User} where {uid} = 'foo'";
#% query = new FlexibleSearchQuery(queryString);
#% result = Registry.getApplicationContext().getBean("flexibleSearchService").search(query);
#% beforeEach: if (result.getResult().isEmpty()) line.clear();
;foo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Well, another option is to override the DefaultImportProcessorclass with your own - public Item processItemData_Impl(final ValueLine valueLine) throws ImpExException is our candidate, and then set this processor in the ImpEx file using the [processor=my.new.awesome.ImportProcessor]
The idea for customization is pretty obvious - do not update if there are no existing items and the header is UPDATE
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.