Creating the Core Classes

Several classes need to be generated for configuration, the enrichment step itself, and the factory that creates it on demand.

Configuration

Create a class called HelloWorldESConfiguration for the configuration. This class will extend the Enrichment Step Configuration class, and also contain a class object that contains enrichment step specific configuration. Here we have a single ‘Text’ property that will contain text to append to the text content on an Aiimi Insight Engine item.

using InsightMaker.Core.Types.Config;

namespace InsightMaker.Enrichment.HelloWorldES
{
    public class HelloWorldESConfiguration : EnrichmentStepConfiguration
    {
        public HelloWorldESConfiguration()
        {
            base.Type = "HelloWorldES";
        }

        public HelloWorldESSpecificConfiguration HelloWorldES { get; set; } 
            = new HelloWorldESSpecificConfiguration();
    }

    public class HelloWorldESSpecificConfiguration
    {
        public string Text { get; set; } = "";
    }
}

Enrichment Step

Create a class called HelloWorldESStep for the actual enrichment step. This class will implement the Enrichment Step interface. For the minute the class will simply print ‘Hello World’ to the console window.

Enrichment Step Factory

Create a class called HelloWorldESFactory that will be responsible for creating the enrichment step.

Creating the Test Console App

We will now create the console app that we use to iterate development and test the enrichment step.

Edit the Program.cs file (or create a Program.cs file) in the console app project.

Before attempting to run this, you will also need to add a log4net.config file. Add the following to the project, being sure to select ‘Copy to Output Directory’ on the files properties.

Now run the console app and you should see the following.