Article Factory Default Automation Providers

Factory default automation providers allow for the definition of new factory default automations which can be further edited but not removed in production environments. Factory default automations are also stored within the file system which enables teams to use the source management system of their choice to develop and version their automations.

Why use Factory Default Providers?

  • Source Control. Each factory default automation provider stores all if its data within a unique folder within the centralized file storage system which can be monitored and included in a source management system for easier team-based development and source control. See Managing Automation Source and Distribution for more details.
  • Ensure Automations are Available. Factory default automations can be modified but not removed in production sites. 
  • Installation and versioning. Factory default automation providers can install and version automations through the installation/versioning API. When installing automations, new automations are immediately installed and modified automations are versioned (a custom version is created if it doesn't already exist) and the underlying factory default is updated to support diff-based viewing of updates installed by the factory default provider. The versioning process provides a text-based message that can be sent to community managers to review updates installed through the versioning API.

Automation File Storage

Each factory default provider stores its automations as XML and supplementary files within the Centralized File Storage system. With default configuration, this is located in the web filestorage/ folder. Assuming a factory default automation identifier of 'e47bcf91df6144db81edc7dc6bca264e,' files would be stored as:

  • filestorage/
    • defaultautomations/
      • e47bcf91df6144db81edc7dc6bca264e
        • ID_OF_AUTOMATION.xml
        • ID_OF_AUTOMATION/
          • SUPPLEMENTAL_FILE.jsm
          • SUPPLEMENTAL_FILE.vm

Where individual automations are stored within a folder with the same name as the ID of the factory default automation provider. Each automation is stored in an XML file named with the ID of the automation. Any supplementary files used by the automation are stored within a sub-folder of the factory default provider's folder named with the ID of the automation that uses the files.

Creating a Factory Default Automation Provider

The IAutomationFactoryDefaultProvider interface has two members:

public interface IAutomationFactoryDefaultProvider : IPlugin
{
    Guid AutomationFactoryDefaultIdentifier { get; }
    void SetController(IAutomationFactoryDefaultController controller);
}

The AutomationFactoryDefaultIdentifier should be a unique GUID representing the provider. The SetController method is used to provide the provider with the installation and versioning API. For more details about the installation/versioning API, see Managing Automation Source and Distribution.

Example

using System;
using Telligent.Evolution.Extensibility.Automation.Version1;

namespace Telligent.Evolution.Platform.Api.Plugins.Automations
{
    public class CoreAutomationFactoryDefaultProvider : IAutomationFactoryDefaultProvider
    {
        private static readonly Guid _id = new Guid("e39e30da-e1f5-4585-8d53-9a45be080d92");
        
        #region Plugin Members

        public string Name => "My Factory Default Automations";

        public string Description => "Automations that I've created.";

		public void Initialize()
        {
        }
        
        #endregion
        
        #region AutomationFactoryDefaultProvider Members
        
        public Guid AutomationFactoryDefaultIdentifier => _id;

        public void SetController(IAutomationFactoryDefaultController controller)
        {
            // controller can be used to install/version automations
        }
        
        #endregion
	}
}

This example creates a new provider named "My Factory Default Automations" where automations would be stored in the filestorage/defaultautomations/e39e30dae1f545858d539a45be080d92 folder.