Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. This Developer Center contains the guides for Commerce 6.13.0 through 7.4.1.Visit new site

This version of Elastic Path Commerce is no longer supported or maintained. To upgrade to the latest version, contact your Elastic Path representative.

What's New for Cortex API 1.14.0

What's New for Cortex API 1.14.0

New Features

  • Request Caching: Request Caching can greatly improve performance, as Cortex can retrieve the domain object from the cache instead of repeatedly retrieving it from your back end system. See here for more information. Please note that we are planning to enable caching outside of the repository. The future change will be backward compatible for the caching you create with this release.
  • New Tutorial on how to create Cortex resources to interface with Commerce Engine
  • A new easy way to check if Cortex is operating by making a cortex call to {server}/cortex/healthcheck without having to authenticate.
  • Addresses is a new Cortex resource. See here for more information about the new resource.
  • Lookups resource has been enhanced to support to look up items for a list of sku codes.

Enhancements

Cortex

  • ExecutionResultChains are no longer required in order to use the Assign and Ensure classes. The existing anonymous ExecutionResultChain wrappers have been removed from all Cortex resources except the very top method of a Resource's dispatch call. This improves ease of debugging and readability of the resource code yet maintains the "happy path' Chain pattern with Assign and Ensure.
  • ExecutionResultChain are removed for item, itemdefinition, emails resources.
  • Moved the getFamily method off the interface and into a utility class
  • Used Constructor injection over field or setter injection
  • Zoom handler to support mininum max-age, i.e., the zoom has a max-age set with the value of the minimum max-age of the resources contained the response.
  • Assets resource has been converted to the latest Cortex programming model.
  • Carts resource supports emptying Cart in one API call. See here for more information.
  • Identifier has been refactored to improve reuse and testability, and to use shorter CompositeId (used in Items, Shipments, Assets) without signing.

Cortex Performance Improvement

  • URITemplate.match() uses Map data structure instead of Multimap so it uses less memory.
  • Caching the results of MethodParameterGenerics.getGenericTypeForMethodParameter
  • Introduced EqualsUtil/Objects.hash() as a replacement for EqualsBuilder/HashCodeBuilder which have performance issues
  • Javassist is used instead of JDK Proxy to generate bindings from Builder interfaces to the concrete builder class. Javassist-generated proxies are faster than JDK proxies and easier to read when debugging.
  • Operation-scoped caching entries are evicted as soon as the request is completed.
  • Testing resource operations for the correct permissions has been optimized to improve performance.

API Changes / Name Changes

Cortex

  • When trying to go into options of an item that does not have options (for example, any single SKU product, from the itemdefinitions page), Cortex now returns a 200 OK with item's definitions instead of throwing a 404.
  • Renamed ResourceState.Build.create() to .builder()
  • Cortex responds dynamic the list of recommendation types, including the newly-introduced ProductAssociationType added in CE during customization. Due to the fact that the recommendations links are dynamic, the out-of-the-box links are changed as follows:
    Before New
    accessories accessory
    crosssells crosssell
    topsellers recommendation
    replacements replacement
    upsells upsell
    warranties warranty
  • The map of Cortex scope to CE storecodes has been removed to improve performance. The storecode is stored in the database in whatever case was entered. In CE, storecode is used in uppercase. In Cortex, the storecode is used as Cortex scope in lowercase.
  • MaxAge
    • Resources with MaxAge set to 0 have been updated to not setting MaxAge.
    • MaxAge declaration has been moved into resource's integration, a lower layer. When max-age has a value, proper max-age is returned in the Cache-Control header. See here for more information. Updated resources with proper max-age values. See below for the cache-control header value for all the OOTB Cortex resources.

Cortex Repository Layer

  • ItemRepository.isItemPurchasableInStore was moved to LineItemLookupStrategyImpl.isItemPurchasable
  • PriceRepository.getLowestPrice replaced 'Product product' input parameter with 'String itemId'. That's the itemId associated to the product.
  • Renamed and refactored 'ExecutionResult<Price> getLowestPrice(String storeCode, Product product, Set<Long> ruleTracker);' to 'ExecutionResult<Set<Long>> getLowestPriceRules(String storeCode, String itemId);', the purpose of this method was to determine the rules transported in the input parameter ruleTracker. Now these rules are returned by the method. If you want to use a method to determine the price use the 'PriceRepository.getLowestPrice' method.
  • PriceRepository.priceExists replaced 'ProductSku productSku' input parameter with 'String itemId'. That's the itemId associated to the productSku.
  • PromotionRepository.getAppliedPromotionsForItem replaced 'Product product' input parameter with 'String itemId'. That's the itemId associated to the product.

Bug Fixes

  • Resolved an issue where cart response time was very long when there were many items in the cart
  • Resolved an issue where modifying tax rates and adding a Note to an order would update order total of an existing order
  • Resolved an issue where @Zoom annotations produce different zoom paths on Linux vs Windows
  • Resolved an issue where roleHierarchy and tokenExpiry didn't show up in Cortex Apache Felix Web Console
  • Resolved an issue where entity definition XML would only allow Entities in <array> declarations. They now successfully accept <string>. <integer>, <boolean>, <long> and <decimal> types. Project can create entities with non-Entity lists of values as needed.
  • Resolved an issue where the internal Property Keys between Legacy Representation and ResourceEntity did not match.
  • Resolved an issue where TypeConverter.typeFromProperty didn't allow a variety of types within an <array>.
  • Resolved an issue where Cortex error occurs when there are concurrent operations against Cortex.