What are the different parts of Sitecore 9?
- xConnect – a separate web application to your main site
- AutomationEngine – this runs as a windows service
- IndexWorker – this also runs as a windows service
- Website – much like the good ol’ days
Adding your own customizations
It’s pretty simple to setup your own custom facets. However what’s slightly harder is how do you deploy these to all of the different functions above? If the dll’s and configs don’t match between e.g. the website and xConnect you will get errors in the logs – luckily these do a good job of explaining the mismatch.
Sharing the love
In its simplest form the process of deploying your custom facet relies on 2 things – the dll that contains the facet and a json representation of the facets. To generate the JSON try this.
Automate the boring stuff
No one likes doing the same thing again and again, especially if you consider deploying something like this to multiple servers in the cloud.
For a recent demo I built a process that worked both locally and remotely. This was great as the octopus deploy step only had to run one exe and the whole deployment glued together as expected.
Just show me the codes!
Just before we do I’ll quickly explain the steps involved:
- Build the code
- Write the json schema
- Deploy the model config (see the sitecore post earlier about this format)
- Deploy the dlls
- Deploy the patch configs
- Deploy the agent configs. Note these assume you are using Slow Cheetah to transform accordingly for each environment
Before you run it you need to:
- Correct the references to things like xConnect etc
- Correct the references to the dlls you want to include and set their names in the DeployDlls method (var dllsToCopy)
- Set the deploymentFolder
All the source code is available online here
One file of note is sc.MarketingAutomation.ActivityTypes.xml – this allows you to patch in things like custom MA Actions, setup dependency injection within the MAEngine and a whole raft more.
Original article was posted on Boro2g Blog: Deploying custom code to xConnect and the marketing automation engine