| layout | default |
|---|---|
| currentMenu | getting-started |
Create a console application called "MyProject" in Visual Studio or Xamarin Studio.
Run the following command in the Package Manager Console.
PM> Install-Package IntegrationEngineNavigate to Project→Add Packages, then search for "InEngine.NET" in the Add Packages GUI.
InEngine.NET requires a host application. It can be a console or service application. The following code snippet demonstrates how to instantiate and initialize InEngine.NET in a console app called MyProject. It also indicates to the instance of EngineHost that it should look in the the assembly containing class MainClass for integration jobs.
// Program.cs
using System;
using System.Reflection;
namespace MyProject
{
class MainClass
{
public static void Main(string[] args)
{
(new EngineHost(typeof(MainClass).Assembly)).Initialize();
}
}
}
The configuration file should be called "IntegrationEngine.json" and its build action should be to "copy if newer."
// MyIntegrationJob.cs
using IntegrationEngine.Core.IntegrationJob;
namespace MyProject
{
public class MyIntegrationJob : IIntegrationJob
{
public override void Run()
{
// Do some work
}
}
}
Post an HTTP request to the IntegrationServer API's CronTrigger resource with a JobType of "MyProject.MyIntegrationJob" - the full name of the job.
curl --data "JobType=MyProject.MyIntegrationJob&CronExpressionString=0 4 1 ? * MON-FRI *" http://localhost:9001/api/CronTrigger