such as fulfillment and inventory management become highly automated • Employees don’t waste time manually entering data • Focus on delivering unique value – not just doing the things a computer could do Magento Commerce + Dynamics NAV
integration • Simple to maintain, low cost of ownership – no one wants to spend their budget on ERP integrations • Easy to support – no one wants to answer tickets about an ERP integration Project Goals
product & inventory data from Dynamics (no PIM) • Export customers and orders from Magento into Dynamics • Import shipment data from Dynamics • Don’t break the Dynamics-powered POS deployed in 30+ stores – this is a real-world deployment, not a theoretical project Business Goals
for all of our integrations • Provides a common set of logging, reporting and UI components • Ensures all of our integrations have a merchant-friendly admin management page Base Module
messaging queue • Magento 2 has native support for communicating with Rabbit • Rabbit libraries for PHP, Java, .NET, Python, Javascript, Ruby & Go so ERP developers can use the language of their choice RabbitMQ
the module necessary to publish and consume Rabbit messages in Magento • ERP integrator or client’s in-house ERP team writes the code to publish and consume Rabbit messages for the ERP RabbitMQ – In General
supports the client’s Microsoft Dynamics instance, so we’re writing both ends of the connection • Continuing to develop best practices around where to host the ERP-specific code in this case – another Magento module or a separate script RabbitMQ – Microsoft Dynamics
– ERP’s library is written in PHP, merchant is using Magento Commerce Cloud • Worst case – client’s ERP utilizes an antiquated language and is hosted behind a strict firewall RabbitMQ – Architecture Questions
is more than a smaller site needs • “Cron mode” enables direct communication from Magento to Dynamics using Magento’s cron system for scheduled tasks • Works well in this case as we are responsible for both the Magento code and the ERP integration code Rabbit Alternative - Cron Mode
manages the actual connection to Microsoft Dynamics • Encapsulates all connection logic so remaining code doesn’t care how the connection works or if it changes Connection Layer
a single Magento module • Module is broken down into 10 main models to implement our layers • Some of the models then break down into smaller components Structure
manages the overall data transformation process • Extractor pulls data from source, uses a Mapper to map fields to a standard format • Transform class performs basic transformations Data Layer
processes changes in Magento that need to happen based on data from the ERP • Allows us to utilize core Magento functions for making these changes • DI & architecture of Magento 2 makes this simple • For instance – we use the core StockRegistryInterface API Data Layer - Processor
NAV can be customized – field names can be changed • Don’t hard-code field names • Separate out implementation-specific code from platform- specific code Lessons Learned
of development work and QA • 10 hours of documentation • Deploying this integration for future Microsoft Dynamics clients could be a 5-10 hour process Implementation Effort
the site aren’t aware the ERP exists – which is our goal • Their orders are fulfilled quickly and they receive a tracking number soon after placing their order • If the customer experience is impacted by your ERP, there’s room to improve that integration Customer-Facing Experience
fulfill orders out of Microsoft Dynamics as they always have – no need to login to a separate system • Customer service representatives can view up-to-date product inventory and order status information in Magento, no need to login to Dynamics • If a sync encounters an issue, detailed information is available in the Magento admin panel for easy troubleshooting and resolution Admin User Experience
connector required a developer to SSH to the server any time the sync failed. • Encrypted code made debugging impossible • No stable base for feature enhancements Developer Experience
to allow other members of the Microsoft Dynamics family to easily integrate with Magento • Developing new adapters based on other integration methods (i.e., CSV files) • Expanding to connect with other ERPs as well Adapters
go live on Magento much more quickly • Errors importing one order no longer stops all other orders from importing • It just works – no longer have to think about the ERP integration Faster, More Reliable Syncing
would’ve taken substantially longer if not for the design patterns and architecture of Magento 2 • Code is cleaner, easier to maintain and more robust thanks to following the Magento 2 architecture Impact of Magento 2