2023:Activity Processing (Service): Difference between revisions

From Grooper Wiki
No edit summary
Tag: Reverted
Line 27: Line 27:
== Example: A single-threaded Activity Processing service for Export ==
== Example: A single-threaded Activity Processing service for Export ==


{{#lst:{{NAMESPACE}}:Export (Activity)|single_threaded_export}}
{{#lst:Export (Activity)|single_threaded_export}}

Revision as of 17:57, 28 December 2023

This article is about an older version of Grooper.

Information may be out of date and UI elements may have changed.

20252024202320222.90

Activity Processing is a Grooper Service that executes Unattended Activities assigned to Batch Steps in a Batch Process.  This allows Grooper to automate Batch Steps that do not require a human operator.

When configuring an Activity Processing service, a Processing Queue may or may not be specified.

  • When unspecified, the service will assign work using the "default" Processing Queue. The Activity Processing service will pick up tasks for any Batch Process Steps that do not have an assigned Processing Queue.
  • When specified, only the Activity Processing' service will only process tasks for Batch Process Steps with that Processing Queue assigned.
    • Be aware, while an Activity Processing service can only be configured to point to a single Processing Queue, multiple Activity Processing services may be added to the Grooper service list (each referencing their own Processing Queues).

About

Unattended Activities in a Batch Process can be automated using an Activity Processing Grooper service. The Activity Processing service will act like a Windows service and automatically start tasks in a Batch, as processing threads in your system's resources become available. This is one of the ways Grooper leverages your system resources for parallel processing.

Imagine you're running Grooper on a machine with eight (8) processing threads. If you have a Batch with five (5) Batch Folders, and each one is on the Recognize step of the Batch Process, there's no need for your system to process each Batch Folder sequentially (with each Batch Folder waiting to be processed until the one before it is finished).

  • You have 8 threads and 5 Batch Folders in this scenario.
  • Each one of those threads can process one Batch Folder as a single task.
  • With 8 available threads, all 5 Batch Folders could be processed concurrently by 5 individual threads.
  • This is multi-threaded Activity processing.

You could then set up an Activity Processing service to process all Unattended Activity steps in a Batch Process with the maximum allowable processing threads available.

Example: A general purpose multi-threaded Activity Processing service

COMING SOON

Example: A single-threaded Activity Processing service for Export

When automating Export steps in a Batch Process, you may need to execute the activity single threaded.

Depending on which external storage system you're exporting to, you may run into errors if you attempt to run the Export activity multi-threaded.

  • This may be due to a storage platform limiting the number of concurrent connections to the repository.
    • For example, licensing limitations for the platform may restrict how many connections can be made to the repository at a time (as is the case for ApplicationXtender).
  • This may be a self-imposed throttle to avoid network/latency related errors when uploading to cloud based platforms (such as Box.com or Microsoft SharePoint).
  • This may otherwise be required or preferable for platforms whose file transfer protocol expects users to upload files one at a time.
    • If you have 5 threads all attempting to upload 5 different Batch Folders from the same machine, 4 of those Batch Folders are going to kick back to Grooper in an error state in this scenario.


For scenarios like these, it is preferable to run the Export activity single-threaded, ensuring only one Batch Folder is processed at a time. As well as automating Batch Processing activities, Activity Processing services allow you to control thread resources by assigning activities a Processing Queue and limiting the number of maximum threads available for that Processing Queue.

Next, we will show you how to create a single threaded Processing Queue for an Export activity, and set up an Activity Processing service that utilizes it. This will effectively throttle your export, so Batch Folders are indeed only exported one at a time, avoiding any issues with external platforms that cannot handle multi-threaded exports.

1. Add a Processing Queue

The first thing you'll need to do is add a Processing Queue object. A Processing Queue defines the "bucket" of threads available to one step or another in a Batch Process. In our case, this will allow us to limit the number of threads the Export step uses to a single thread.

Click here for an interactive walkthrough

To add a Processing Queue:

  1. Right-click the Queues folder in the Node Tree.
  2. Select "Add".
  3. Select "Processing Queue"
  4. This will bring up a new window to name the Processing Queue. Enter a name.
    • We named ours "Export Throttle"
  5. Select "Execute."
  6. This will add a new Processing Queue object to the Node Tree.
  7. FYI: No further object configuration is technically required at this point.
    • However, if you want the safest implementation of a single-threaded Processing Queue, totally ensuring only a single Export task is processed per repository environment, you can change the Concurrency Mode property from Multiple to Single. With the Single mode, only a single task will run per Grooper repository.

2. Assign the Processing Queue

Next, we need to tell our Batch Process which step should use our new Processing Queue.

Click here for an interactive walkthrough.

  1. By default, all Batch Process steps use the "Default" Processing Queue.
  2. In the Batch Step property grid, Processing Queues are assigned with the Processing Queue property.



We want to tell the Export step of this Batch Process to use a different Processing Queue, the new one we just created.

  1. Select the Export step in the Batch Process.
  2. Select the Queue Name property.
  3. Using the dropdown menu, select the Processing Queue you wish to use.
    • In our case, the "Export Throttle" Processing Queue.

|

3. Configure an Activity Processing Service

On to Grooper Command Console! Grooper services are installed and edited using Grooper Command Console. Open Grooper Command Console to install a new Activity Processing service.

Grooper Command Console must be run as an administrator to install and edit services.

  1. In Grooper Command Console enter the following command:
services install <connectionNo> <typeName> <userName> <password> [threadCount] [queueName]
  • <connectionNo> (required):
  • Replace this with the integer representing the appropriate connection. Use the connections list command to get a list of your connections.
  • <typeName> (required):
  • Since we are installing an Activity Processing service, replace this with ActivityProcessing.
  • <userName> and <password> (required):
  • Replace these with the appropriate Active Directory credentials of your Grooper Service User.
  • [threadCount] and [queueName] (optional):
  • If you want to specify a specific thread count, replace [threadCount] with an appropriate integer. Setting this to an integer of "1" will specify this service to only use a single procssing thread.
  • If you want to specify a queue name, replace [queueName] with the name of an appropriate Processing Queue object. Enter the name here of the Processing Queue that was created in the Queues folder object on the "Design" page.