Example Service DLL (SDK)

This topic provides a sample service DLL (SDK) for download, shows how to convert it to an Automation Studio package, and how to import the package into an Automation Studio project.

Download the Source Files and Compiled DLL

Download the files for a sample service DLL (SDK) here.

The downloaded ZIP file includes:

  • The source files used to create the DLL

  • The compiled DLL to import into Automation Studio

    The compiled DLL file to import into Automation Studio is located in the folder...\VisualStudioSample_03_04_2021\bin\Debug and is named Sample.dll.

Import the Sample DLL into Automation Studio

For instructions on how to import a service DLL into Automation Studio, see Import a Service DLL (SDK) into Automation Studio.

The full process is demonstrated below.

  1. Open the Automation Studio Package Generator, typically at C:\Program Files (x86)\NICE Systems\Automation Studio. (For more information, see Use the AS Package Generator.)

  2. Click Add.

  3. Navigate to the folder where the DLL file to be packaged is located, select the DLL file, and click Open.

  4. Set the package name and version, and enter a description.

  5. Click Create.

    A success message is shown.

  6. Click the link to open the location where the package was saved.

    The package is saved in the folder %appdata%\Nice_Systems\AutomationStudio\NuGet Packages.

  7. Open a new or existing Automation Studio project.

  8. Click the Import button .

  9. From the drop-down menu, select Import Package.

    The Import Package window lists all packages located in the folder %AppData%\Nice_Systems\AutomationStudio\NuGet Packages.

  10. Select the package to import and click Import.

    The package and its contents are listed under Imported Packages in the Assets Panel.

Download a Sample Automation Studio Project

Download an Automation Studio project that uses the functions in the sample service here.

Unzip and copy the files to the folder %AppData%/Nice_Systems/AutomationStudio/Project.

This project includes one workflow for each function in the sample service. It also includes a single event handler that reacts to the service's Received event.

The workflows are presented in the section below.

View the Source Project

To see how the DLL functions were created, review the source files downloaded above. The project contains the class Class1.cs with the following functions:

  • Check for Character in Text: Checks whether the specified character exists at the specified position (1-based) in the specified text string.

  • Create Timer: Creates a timer of the specified duration (seconds). The Received event in the Sample Library is triggered after that duration elapses. The time at which the duration elapses is returned in the event's Received value parameter.

  • Open Webpage:Opens the Google home page.

  • Run a Boolean Method: Runs a method that receives a Boolean parameter and returns the opposite value.

  • Run a DateTime Method: Receives a DateTime parameter and returns a date two weeks later.

  • Run a Decimal Method: Receives a decimal parameter, adds 0.5, and returns a decimal value.

  • Run a Numeric Method: Receives a number parameter, adds 2, and returns a number.

  • Run a Text Method: Runs a method that receives a text parameter, appends NICE!, and returns a string.