User Script
Users can create simple custom tasks using the HPE.Ianus.Scripting.IScript
interface.
namespace HPE.Ianus.Scripting
{
public interface IScript
{
Task.TaskStatus Run(Task t);
}
}
The class must therefore implement the method Run
, to performed the desired actions and return the desired status for the task.
The method Run
receives the following input parameters:
Parameter | Description |
---|---|
task | The current Task object |
Thru the task
parameter, the user code can access the Ianus runtime information.
Once done, the method should return a value in the HPE.Ianus.Task.TaskStatus
to indicate the task status.
The user script class can be coded in C# when embedded as script, and in any .NET language (including COBOL if available) when provided as DLL.
Example
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HPE.Ianus;
using HPE.Ianus.Scripting;
namespace UserScript
{
public class SampleScript01 : HPE.Ianus.Scripting.IScript
{
public Task.TaskStatus Run(Task task)
{
task.Log.Info("Hello world!");
return Task.TaskStatus.Success;
}
}
}