core.hctab.sh 1.0.5

dotnet add package core.hctab.sh --version 1.0.5
                    
NuGet\Install-Package core.hctab.sh -Version 1.0.5
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="core.hctab.sh" Version="1.0.5" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="core.hctab.sh" Version="1.0.5" />
                    
Directory.Packages.props
<PackageReference Include="core.hctab.sh" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add core.hctab.sh --version 1.0.5
                    
#r "nuget: core.hctab.sh, 1.0.5"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package core.hctab.sh@1.0.5
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=core.hctab.sh&version=1.0.5
                    
Install as a Cake Addin
#tool nuget:?package=core.hctab.sh&version=1.0.5
                    
Install as a Cake Tool

hctab.sh

Build Status Nuget Version Nuget GitHub issues GitHub stars GitHub license

This is a simple library, designed only for the .NET Framework, which allows the rapid creation of multi-step batch programs with scheduling included. Through a simple configuration file (json for now, soon also through SQL database!) It is possible to configure the steps of the batch. The creation of a step occurs by extending the base class BatchStep and configuring the namespace relating to it in the json file. The activation and execution of the step takes place at runtime.

Let's Start!

Before doing anything else you need to configure the environment.

At the moment it is possible to configure the batch through a configuration file "Config.json" which can be located in any folder.

class Program
{
    static void Main(string[] args)
    {
        var batch = new Batch();
        batch.Init("Config/Config.json");
        Console.Read();
    }
}

By instantiating the Batch class, you can call the Init method with the "ConfigPath" parameter which indicates the path where the configuration file is located.

Config File

{
"Name":"Batch",
"StepList": [
	{
		"ID": 0,
		"Name": "Step 1",
		"Description": "batch step 1",
		"Active": true,
		"ClassName": "test.hctab.sh.Step1",
		"Scheduling": [
			{
				"DaysOfWeek": "sun,mon,tue",
				"hhmmFrom": "15:30:00",
				"hhmmTo": "23:20:00"
			},
			{
				"DaysOfWeek": "sun,mon,tue",
				"hhmmFrom": "23:00:00",
				"hhmmTo": "24:00:00"
			}
		],
		"isSchedulerActive": true,
		"RunOrder": 1
	},
	{
		"ID": 1,
		"Name": "Load Files",
		"Description": "Load files from fb",
		"Active": true,
		"ClassName": "test.hctab.sh.LoadFiles",
		"Scheduling": [
			{
				"DaysOfWeek": "sun,mon,tue",
				"hhmmFrom": "15:30:00",
				"hhmmTo": "23:00:00"
			}
		],
		"isSchedulerActive": true,
		"RunOrder": 2
	}

]
}

This is the configuration file also used in the Test project, test.hctab.sh.

  • "Name": String type value, used to declare the batch name
  • "StepList": Array type value, contains a list of steps
  • "ID": Int type value, identifies the step
  • "Name": String type value, used to declare the step name
  • "Description": String type value, used to declare the description of the step
  • "Active": Boolean type value, used to define if the step is active or not
  • "ClassName": String type value, used to specify the class name (with namespace) of the step. Very important for runtime activation.
  • "Scheduling": Array type value, contains a list of schedulers
  • "DaysOfWeek": String type value, it contains the days (the first 3 letters) separated by commas, used for the activation of the scheduling of the step
  • "hhmmFrom": String type value, contains the start time (00:00:00) in which the step can be scheduled
  • "hhmmTo": String type value, contains the end time (00:00:00) in which the step can be scheduled
  • "isSchedulerActive": Boolean type value, if it is true, it will enable the schedulations, else it will check for the "Active" parameter to determine if the step can be ran.
  • "RunOrder": Int type value, to determine the order of the step, ascending order.

Step Code Example

using core.hctab.sh.Batch;
using core.hctab.sh.Interfaces;
using System;
using System.Collections.Generic;


namespace test.hctab.sh
{
    class Step1 : BatchStep, IBatchStep
    {

        public override bool IsApplicable()
        {
            return true;
        }

        public override void ReadData()
        {
        }

        public override void SaveData()
        {
        }

        public override void Verify()
        {
        }
    }
   
}

For any more information check the Test project!

Product Compatible and additional computed target framework versions.
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.5 637 6/23/2020
1.0.1 593 6/21/2020
1.0.0 620 6/21/2020

1.0.5 release