 
     @validator.fetchResources(@resourceCache)
     .then (resources) =>
+      @states = @validator.states
       @resourceCache = resources
 
       if _.isString(csv) || csv instanceof Buffer


  create: (product, rowIndex, publish = false) ->
    if (not product.state? and @defaultState?)
      product.state = { typeId : "state", id : @validator.states.key2id[@defaultState] }
    if @dryRun
      Promise.resolve "[row #{rowIndex}] DRY-RUN - create new product."
    else if @updatesOnly

  update: (product, existingProduct, id2SameForAllAttributes, header, rowIndex, publish) ->
    product.categoryOrderHints = @_mergeCategoryOrderHints existingProduct, product
    if (not product.state? and not existingProduct.state? and @defaultState?)
      product.state = { typeId : "state", id : @states.key2id[@defaultState] }
    allSameValueAttributes = id2SameForAllAttributes[product.productType.id]
    config = [
      { type: 'base', group: 'white' }
