Scripting Setup: Difference between revisions

From Grooper Wiki
Line 91: Line 91:


=== Compile the script and test it in Grooper ===
=== Compile the script and test it in Grooper ===
<!---


== Previous instructions ==
== Previous instructions ==

Revision as of 10:00, 2 May 2025

This article is about the current version of Grooper.

Note that some content may still need to be updated.

2025 2023.1

Before you start creating custom Grooper scripts, there's a few things you need to do.

About

Grooper's core capabilities can be expanded with custom scripts written in C# or Visual Basic for the .NET platform. With scripts you can:

  • Create a Grooper extension Object Library to create custom Activities, Commands, Services, CMIS Connection Bindings, and other Grooper objects.
  • Create settings Batch Process scripts to alter how Batch Process Steps are executed.
  • This functionality has largely been replaced by the "Should Submit" and "Next Step" expressions in a Batch Process.
  • Create data_table Data Model scripts to perform custom validation events or data normalization logic.
  • This functionality has largely been replaced by Grooper's Data Rules.
  • Create pin Data Type scripts to perform custom extraction validation and manipulation.
  • This functionality too has largely been replaced by Grooper's Data Rules. Most users now prefer to normalize extraction results after it has been extracted with Data Rules and the Apply Rules activity.


Before you get started coding, there are a few requirements:

  1. You must have Visual Studio 2022 installed on your machine.
  2. This installation must have the ASP.NET and web development workload installed.
  3. You must install the Grooper SDK Visual Studio extension.
    • This is required to debug your scripts in a web browser.
  4. You must be on a machine where Grooper and the Grooper Web Client applications are installed. This means either:
    • Visual Studio must be installed on the Grooper web server and you do all your scripting from there.
    • Or (more commonly) you will need to connect to the Grooper Repository and perform some additional setup (See "#Remote web scripting setup" below)

Setting up a scripting environment

Step 1: Decide where you're going to script

The Grooper web server is the server hosting the Grooper website. Most commonly, there is one Grooper web server connected to a Grooper Repository. That way, all users can access the Grooper Repository with a single URL, instead of installing Grooper on their own machines (Yes, I just explained the advantages of web-based applications to you).

In order to debug your scripts, you must be working in Visual Studio on a machine where Grooper is installed and the Grooper Web Client is installed and IIS is hosting the Grooper website.

You have two options. You can script:

  • Locally - On the Grooper web server
  • Remotely - On any other machine that can connect to the Grooper Repository (with some additional setup required)


If you're scripting locally, there is less setup involved. But this is generally not preferred.

  • There are good reasons you won't want to install Visual Studio and script on the Grooper web server.
  • Example: If you ever need to recycle the Grooper app pool during your debugging process or after compiling a script, you want that to affect only you and not every other user connected to the Grooper Repository.
  • Example: Multiple users attempting to script at the same time on the web server may cause issues.

If you're scripting remotely, there is some more setup. But this is generally preferred.

  • To script remotely, you will spin up a local Grooper web server on your own machine, connect to the Grooper Repository and debug using the localhost URL.
  • We will walk you through these steps in Step 3 of this tutorial. But in all circumstances, Visual Studio must be installed and configured properly first.

Step 2: Configure Visual Studio and install the Grooper SDK extension

After deciding if you're scripting locally or remotely, you will need to set up Visual Studio on whatever machine you're going to use. Microsoft Visual Studio 2022 is the supported version for developing with Grooper 2025.

  1. Install Visual Studio 2022 on your machine if you have not done so already.
  2. Be sure your Visual Studio install includes the "ASP.NET and web development" workload. Install it if it does not.


Next, install the Grooper SDK extension for Visual Studio. This is required to debug Grooper scripts using a browser target.

  1. Launch Visual Studio (as an administrator).
  2. For now, under "Get Started" choose "Continue without code".
  3. Click the "Extensions" menu.
  4. Choose "Manage Extensions".
  5. Search for "Grooper"
  6. Select "GrooperSDK" and click "Download"
  7. After the extension downloads, close Visual Studio to begin modifications.
  8. After closing Visual Studio, the VSIX installer launches. Click "Modify" to install the GrooperSDK extension.
  9. After installation is finished, click "Close".
  10. Re-launch Visual Studio (as an administrator).
  11. Automatic updates?


Next, set a debug target page. This will ensure the default page opened in your browser will be the Grooper "Home" page or whichever page you prefer.

  1. In Visual Studio, click the "Tools" menu.
  2. Choose "Options".
  3. In the Options menu, select and expand "Grooper".
  4. Select "Debugging".
  5. Using the "Start Page" property, select a debug target. This can be the Home page or any of the other main navigation pages in the Grooper UI.


If you are scripting locally, you can start scripting. You may continue to #Creating and debugging Grooper scripts for more information if you need.

If you are scripting remotely, read on to learn how to set up your remote scripting machine.

Step 3: Set up a remote scripting machine (if scripting remotely)

Creating and debugging Grooper scripts

Create a script and local project files in Grooper

Edit the project in Visual Studio

Debug the project in a browser

Compile the script and test it in Grooper