   # 3) Update SPHERE orders with sync information
   ###
   execute: (mappings, targetPath) ->
+    @mappings = mappings
     @startTime = new Date().getTime()
     orderQuery = @_buildOrderQuery @_options.numberOfDays
 

    _.filter orders, (order) ->
      _.size(order.syncInfo) is 0 or _.find order.syncInfo, (syncInfo) -> syncInfo.channel.id isnt channel.id

  _ordersToXML: (orders, mappings) ->
    root = builder.create('Orders', { 'version': '1.0', 'encoding': 'UTF-8'})
    root.att('count', orders.length)
    _.each orders, (order, index, list) =>
      orderXML = root.ele("Order", {num: index + 1})
      @_orderToXML(order, orderXML, mappings)
    root

  _orderToXML: (order, orderXML, mappings) =>
    @logger.info "[OrderExport] Processing order with orderNumber: '#{order.orderNumber}', id: '#{order.id}'"
    orderXML.e('OrderId').t(order.orderNumber)
    orderXML.e('OrderDate').t(order.createdAt)

      api.queryOrders(@rest, orderQuery)
      @_loadOrdersXsd './examples/xsd/orders.xsd'
    ], (fetchedOrders, ordersXsd) =>
      utils.assertProductIdMappingIsDefined @mappings.productImport.mapping
      utils.assertVariationIdMappingIsDefined @mappings.productImport.mapping
      utils.assertSkuMappingIsDefined @mappings.productImport.mapping
      if fetchedOrders
        @client.channels.ensure(@mappings.orderExport.channel.key, @mappings.orderExport.channel.role)
        .then (createOrGetChannelResult) =>
          @channel = createOrGetChannelResult.body
          # TODO refactor as soon as collection query in SPHERE.IO is fixed
          @unsyncedOrders = @_filterByUnsyncedOrders(fetchedOrders.results, @channel)
          if _.size(@unsyncedOrders) > 0
            @logger.info "[OrderExport] Orders to export count: '#{_.size @unsyncedOrders}'"
            xmlOrders = @_ordersToXML(@unsyncedOrders)
            content = xmlOrders.end(pretty: true, indent: '  ', newline: "\n")
            @_validateXML(content, ordersXsd)
            @fileName = @_getFileName(targetPath)
