• User's guide
  • API
Search Results for

    Show / Hide Table of Contents
    • Concepts
    • Installation
    • Configuration
      • Overview
      • License
      • Datasources
      • Configuration
      • Plug-Ins
      • Codepages
      • Environment Variables
      • Include files
      • Example
    • Jobs
      • Jobs
      • Include
      • Multi-Threaded Jobs
      • Tracking Jobs
    • Tasks
      • Overview
      • Copy Check
      • Excel
      • File Compare
      • File Copy
      • File Dump
      • File Edit
      • File Format
      • Foreach
      • Generate
      • IMS/DB Data Conversion
      • JCL Submit
      • Listcat
      • Log
      • Powershell
      • Set Environment Variable
      • Sql
      • Stored Procedure Compare
      • Table Compare
      • Table Copy
      • Table Load
      • Table Scan
      • Table Unload
      • User Script
    • Layouts
      • Overview
      • XML Definition
      • COBOL Definition
      • Field data Types
    • Extensibility
      • Extending Ianus
      • Column Comparators
      • Column Converters
      • Record Comparators
      • File Editors
      • User Script
      • Record Layout Match Class
      • Column Layout Match Class
      • User Fields
      • Codepages
      • Resources
    • Usage
      • Command Line
      • Monitors
      • Programmatically
      • Unit Testing
    • Known Issues
    • Disclaimers

    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;
            }
        }
    }
    
    In This Article
    Back to top Copyright 2021 - Hewlett-Packard Enterprise