Multiple external systems
Shows how to configure multiple external systems for Optimizely Forms.
NoteOptimizely Forms is only supported by MVC-based websites and HTML5-compliant browsers.
From version 4.18.0, Optimizely Forms can support multiple external systems. Editors can choose one of the registered systems as a connected data source in the user interface.
To make Optimizely Forms support multiple Marketing Automation connectors:
-
Create an instance of
IExternalSystemand register this with Forms.var efmService = ServiceLocator.Current.GetInstance<ExternalSystemService>(); var custom1 = new CustomExternalSystem("Custom_1"); custom1.Datasources = GetSomeDatasources(custom1); var custom2 = new CustomExternalSystem("Custom_2"); custom2.Datasources = GetSomeDatasources(custom2); efmService.RegisterExternalSystem(custom1); efmService.RegisterExternalSystem(custom2); -
Forms automatically activates
ExternalSystemwith the default constructor and registers this with Forms. You can override this default behavior. -
Allow the display name of the
ExternalSystemby ID. You can get theDisplayNamelocalization resource from the XML path:/episerver/forms/externalsystems/{system.Id}/displaynameIf that resource does not exist, fallback to the default one (like previous versions):
/episerver/forms/externalsystems/{system.GetType().FullName}/displayname
API changes from version 4.18.0
- A service,
ExternalSystemService, is introduced for working with external systems:WorkingExternalSystem– Get currently activated external systems.HasExternalSystems()– Determine whether there is any implementation ofIExternalSystem.ActivateFromTypes()– Automatically try to create instances ofIExternalSystemby scanning the assembly. This requires the default constructor of theExternalSystem. If you do not want to activate your automaticallyExternalSystem, override this method and do nothing or do not provide the default constructor for theExternalSystem.RegisterExternalSystem– Explicitly register anExternalSystem. EachExernalSystemmust have a unique ID. The ID should not contain spaces or special characters.UnregisterExternalSystem– Remove anExternalSystem.GetExternalSystem– Return instance of anExternalSystemby ID.GetAllExternalSystems– Return instances ofExternalSystem(activated, registered)
- The property
IPostSubmissionActor.ActiveExternalFieldMappingTablewas obsoleted because the Actors should not know about the mappings. If you want to have a mapping table in Actors, you can useIExternalFieldMappingService.GetActiveFieldMappingTablesto retrieve them.
Updated about 2 months ago