<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Factory Default Automation Providers</title><link>https://community.telligent.com/community/11/w/developer-training/65583/factory-default-automation-providers</link><description /><dc:language>en-US</dc:language><generator>14.0.0.586 14</generator><item><title>Factory Default Automation Providers</title><link>https://community.telligent.com/community/11/w/developer-training/65583/factory-default-automation-providers</link><pubDate>Tue, 18 Jun 2019 17:42:07 GMT</pubDate><guid isPermaLink="false">05b9da0f-ce1e-43bb-be45-3c309f9938c2</guid><dc:creator>Ben Tiedt</dc:creator><comments>https://community.telligent.com/community/11/w/developer-training/65583/factory-default-automation-providers#comments</comments><description>Current Revision posted to Developer Training by Ben Tiedt on 06/18/2019 17:42:07&lt;br /&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;[toc]&lt;/p&gt;
&lt;h2&gt;&lt;a id="Why_use_Factory_Default_Providers" name="Why_use_Factory_Default_Providers"&gt;&lt;/a&gt;Why use Factory Default Providers?&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Source Control. Each factory default automation provider stores all if its data within a unique folder within the [[Centralized File Storage|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.&lt;/li&gt;
&lt;li&gt;Ensure Automations are Available. Factory default automations can be modified but not removed in production sites.&amp;nbsp;&lt;/li&gt;
&lt;li&gt;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&amp;#39;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.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;a id="Automation_File_Storage" name="Automation_File_Storage"&gt;&lt;/a&gt;Automation File Storage&lt;/h2&gt;
&lt;p&gt;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 &amp;#39;&lt;span&gt;e47bcf91df6144db81edc7dc6bca264e&lt;/span&gt;,&amp;#39; files would be stored as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;filestorage/
&lt;ul&gt;
&lt;li&gt;defaultautomations/
&lt;ul&gt;
&lt;li&gt;&lt;span&gt;e47bcf91df6144db81edc7dc6bca264e&lt;/span&gt;
&lt;ul&gt;
&lt;li&gt;ID_OF_AUTOMATION.xml&lt;/li&gt;
&lt;li&gt;ID_OF_AUTOMATION/
&lt;ul&gt;
&lt;li&gt;SUPPLEMENTAL_FILE.jsm&lt;/li&gt;
&lt;li&gt;SUPPLEMENTAL_FILE.vm&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;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&amp;#39;s folder named with the ID of the automation that uses the files.&lt;/p&gt;
&lt;h2&gt;&lt;a id="Creating_a_Factory_Default_Automation_Provider" name="Creating_a_Factory_Default_Automation_Provider"&gt;&lt;/a&gt;Creating a Factory Default Automation Provider&lt;/h2&gt;
&lt;p&gt;The IAutomationFactoryDefaultProvider interface has two members:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;public interface IAutomationFactoryDefaultProvider : IPlugin
{
    Guid AutomationFactoryDefaultIdentifier { get; }
    void SetController(IAutomationFactoryDefaultController controller);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;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&amp;nbsp;&lt;span&gt;[[Managing Automation Source and Distribution]].&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;&lt;a id="Example" name="Example"&gt;&lt;/a&gt;&lt;span&gt;Example&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="csharp"&gt;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(&amp;quot;e39e30da-e1f5-4585-8d53-9a45be080d92&amp;quot;);
        
        #region Plugin Members

        public string Name =&amp;gt; &amp;quot;My Factory Default Automations&amp;quot;;

        public string Description =&amp;gt; &amp;quot;Automations that I&amp;#39;ve created.&amp;quot;;

		public void Initialize()
        {
        }
        
        #endregion
        
        #region AutomationFactoryDefaultProvider Members
        
        public Guid AutomationFactoryDefaultIdentifier =&amp;gt; _id;

        public void SetController(IAutomationFactoryDefaultController controller)
        {
            // controller can be used to install/version automations
        }
        
        #endregion
	}
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This example creates a new provider named &amp;quot;My Factory Default Automations&amp;quot; where automations would be stored in the filestorage/defaultautomations/e39e30dae1f545858d539a45be080d92 folder.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item></channel></rss>