Grooper 21.00.0082 is available as of 12-12-2023! Check the  Downloads Discussion  for the release notes and to get the latest version.
Grooper 23.00.0042 is available as of 03-22-2024! Check the Downloads Discussion for the release notes and to get the latest version.
Grooper 23.1.0018 is available as of 04-15-2024! Check the  Downloads Discussion  for the release notes and to get the latest version.
Options

Creating and Using Scripts

jongoesboomjongoesboom Posts: 26 ✭✭✭

Creating and Using Scripts

A Grooper Script is a program that runs inside of Grooper. It contains instructions (called script code) to make Grooper perform custom tasks. Scripting extends Grooper functionality, and any functionality that Grooper does not already handle out of the box can be accomplished using scripting.

Prerequisites

Software Required

  • Microsoft Visual Studio 2013

  • Microsoft .NET Framework 4.5 SDK

  • Microsoft Visual Studio Tools for Applications 2013

Skills Necessary

  • .NET programming experience with Visual Basic

Creating Scripts

The following Grooper object types (followed by an example of usage) support scripting:

  • Batch Process - Modify the flow of a Batch Process.

  • Processing Script - Implement a custom Batch Processing Step.

  • Data Model - Validate data, customize the Data Review interface, perform custom database lookups.

  • Data Type - Validate extracted elements.

  • IP Profile Perform custom image cleanup.

  • Report - Build custom reports.

  • Scripted Service - Write a script which executes as a Windows service.

To create a script, follow the directions below.

  1. Go to the scripting tab on the object you want to add scripting to.


  2. Next, click the Create button on the toolbar.




Editing Scripts

  1. Once you have created the script, select it and then click on Edit in Visual Studio.


  2. Visual Studio will open and from there you can edit your script.

  3. Once you are done editing, save your files in Visual Studio and then close Visual Studio.

  4. After closing Visual Studio, a message box will pop up. Click Yes


Debugging in Visual Studio

To test your script, you can use the debug menu in Visual Studio. This will open an instance of Grooper Administration, Attended Client, or Unattended Client based on what you have specified. Here you can test your scripts functionality.

To change this setting, you can click on the Debug Target: dropdown to change the target you are wanting to debug against.

Compiling the Script

Before Scripts can be used they must be compiled. To compile a script, follow the directions below.

  1. Select the Script that you need to compile and click on Compile.


  2. You can see the status in the lower Output pane in Grooper. When it is done compiling, you will need to restart Grooper Administration for the script to work.


Using Scripts

All Grooper scripts interact with Grooper by responding to events. The events available vary depending on the type of object. For example, a Data Model exposes events such as AfterExtraction, FieldEnter, FieldExit, and etc., while a Batch Process exposes events such as BatchCompleting and BatchCompleted. The list of events available for each object type can be found in the Object Reference under the topic for the specific object type.

Comments

  • Options
    [Deleted User][Deleted User] Posts: 0 admin
    edited January 2018
    A few notes:
    • Microsoft Visual Studio Tools for Applications 2013 requires Update 1 to work with Grooper Scripting.
    • Debugging a Batch Process script will function differently than other nodes, as the process itself will have to first be published to utilize the script changes.
    • Debug Target will need to be changed, depending on where your script is running and in what context you are wanting to test.
    • When exporting/importing a script between Grooper instances, the Actions > Update References will need to be used after import before the script will compile.
Sign In or Register to comment.