Inject your own activity type service
You can use your own service in the context of an activity type. You must register custom services in configuration and inject them in the activity type constructor.
Create a service and add it to the activity type constructor
Create a service and add it to the activity type constructor
-
Create an interface and a concrete implementation for your service. The following example uses an
IExampleServiceinterface and anExampleServiceconcrete class: -
Add the service interface to the constructor of your activity type and set a private service property as shown:
Add the service to the configuration
Add the service to the configuration
-
Navigate to the following folder in the Automation Engine root:
\App_Data\Config\sitecore\MarketingAutomationTipIn a local instance, the Automation Engine is located in the
C:\path\to\xconnect\App_data\jobs\continuous\AutomationEnginefolder. -
Create a new XML file that extends
sc.MarketingAutomation.ActivityServices.xmland registers your custom services:NoteNode names must be unique - for example, there can only be one
Documentation.ExampleServicenode. The node name is up to you - it does not need to be the full namespace of the service.