Skip to main content

xSuite Interface Windows Prism 5.x – Online Help

Creation of Custom Program Components

In order to implement special functionalities that are not part of standard xSuite Interface functionality, the user can integrate custom program code for certain components.

The following interface modules and processing modules allow the integration of custom program code:

  • Input system

  • Input format

  • Index Data Reader

  • Output format

  • Output system

  • All types of macro functions

Custom components must be provided in the form of a .NET class library whose version is compatible with that of the main program. Currently, the main program is using .NET version 8.0.

Notice

The Examples\CustomModules subfolder of the program installation contains a rudimentary sample .NET project that contains a class for each type of custom module and custom macro function for the purposes of illustrating the basic mode of operation. Note that these use cases are not meaningful in terms of the content. Also, the examples have been kept simple through the omission of error handling and input-data validity checks.

The CustomModules.dll file is available in the xSuite Interface program directory. This file must be integrated into the customer class library as a dependency component. The XSuite.Interface.CustomModules.Models namespace contains the class definitions for all special data types that are used in the modules and macro functions (e.g., for batches, documents, and file attachments). These are not original data models with which the program works internally, but greatly simplified variants with properties that are specifically intended for data exchange with the custom components.

Property

Description

string ExternalId

External ID that uniquely identifies the batch in the input system

string Name

Display name of the batch in xSuite Interface

IList<Document> Documents

All documents contained in the batch (in ascending order)

IList<string> BackupFiles

IList<string> BackupFolders

Complete paths of all input files or input folders if the input system is file system-based

These values can be set when reading in a batch in a separate input system if the input data is to be backed up by the program's internal backup service. Either individual files or entire folders can be specified. The contents of these files or folders are included in the backup.

Property

Description

string ExternalId

External ID that uniquely identifies the document in the input system

string Name

Display name of the document in xSuite Interface

IList<Attachment> Attachments

All file attachments contained in the document

IList<Field> Fields

All fields contained in the document

IList<string> BackupFiles

IList<string> BackupFolders

Complete paths of all input files or input folders (analogous to the properties of the same name in the stack class)

These values can be set at the level of either the batch or the individual document.

IDictionary<string, string> ExternalKeys

IDictionary<string, string> MetaData

Name/value pairs of external key values and document metadata

Values generated during output to an external system can be added here in a separate output system.

Property

Description

string Name

File name including extension

string FilePath

Complete file path if the input system is file-system-based

If the binary data of the file is not set directly in FileData when reading in a document in a separate input system or input format, this path will be used by the program to read in the file content subsequently.

Stream FileData

Binary data of file attachment

The binary data does not necessarily have to be set when reading in a document if a FilePath is specified. When transferring a document to a custom component, whether the binary data is also transferred is dependant on the context and configuration.

IDictionary<string, string> ExternalKeys

IDictionary<string, string> MetaData

Name/value pairs of external key values and metadata of the file attachment

Values generated during output to an external system can be added here in a separate output system.

Property

Description

string Name

Name of the field as defined in the field catalog

object Value

Value of the field in a supported .NET data type

The following .NET data types are supported by the macro interpreter:

  • string (text value)

  • double (numerical value)

  • bool (Boolean value)

  • System.DateTime (date value)

  • System.Array

IList<TableRow> Rows

Table rows (if the field contains tabular data) or null

Caution

When connecting your own program components, only flat table structures (i.e., no nested sub-tables) are supported.

This applies to the transfer of field contents read in or changed by an external component, as well as to the transfer of existing field contents to an external component.

Property

Description

IList<Field> Fields

Fields contained in the table row

Property

Description

string Name

Name of the field according to the definition .Field[].Name in the field catalog

string InputName

Name of the field under which the field is read from the index file according to the definition .Field[].InputName of the index data reader

Property

Description

string Name

object Value

IList<TableRow> Rows

Properties analogous to the Field class

string OutputName

Name of the field under which the field is written to the output file or transferred to the output system according to the definition .Field[].OutputName of the output format or output system

The interface definition "ICustomLogger" describes a logging component that is passed to the custom classes as a call parameter in the constructor and the macro functions. This component is defined in the XSuite.Interface.CustomModules.Interfaces namespace and is used to output log entries from the custom code directly to the xSuite Interface logs.

Method

Description

void Log(
   LogLevel logLevel = LogLevel.Information,
   string message = "",
   int indentLevel = 0,
   Exception exception = null)

The logLevel corresponds to the Logging.Level property in the global configuration. The following values are available:

  • Trace

  • Debug

  • Information

  • Warning

The message is the text to be output. The program displays the texts partially indented for better readability. The indentLevel specifies the desired degree of indentation. The exception object can also be output for warnings and errors.