Route: Difference between revisions

From Grooper Wiki
Created page with "The '''Route''' activity in Grooper is a powerful tool for dynamically directing Batches or Batch Folders into specific Batch Processes based on their Content Type and other configurable rules. It enables flexible, rule-based workflow branching, allowing organizations to automate complex document processing scenarios with precision and control. == What is the Route Activity? == The Route activity evaluates the Content Type of each Batch or Bat..."
 
 
(2 intermediate revisions by the same user not shown)
Line 36: Line 36:
# When the Route activity runs, it evaluates each item in scope (batch or folder), applies the first matching route, and moves or clones the item into the target process as configured.
# When the Route activity runs, it evaluates each item in scope (batch or folder), applies the first matching route, and moves or clones the item into the target process as configured.


=== Batch-Level Routing with Cloning Disabled ===
=== Batch-Level Routing ===


When routing at the batch level and cloning is disabled, the Route activity leverages the routing functionality of the [[Batch]] object. The batch is moved to the target folder, and its routing properties are set to indicate the new process and step. The batch remains in its current state until routing is applied (typically when the batch is resumed or a routing command is executed), enabling seamless workflow transitions without unnecessary data movement.
When routing at the batch level and cloning is disabled, the Route activity leverages the routing functionality of the [[Batch]] object. The batch is moved to the target folder, and its routing properties are set to indicate the new process and step. The batch remains in its current state until routing is applied (typically when the batch is resumed or a routing command is executed), enabling seamless workflow transitions without unnecessary data movement.


== Data Transformation During Routing ==
=== Data Transformation During Routing ===


If routing between different [[Content Type]]s, you can define Data Actions to map, copy, or transform data fields as part of the routing process. This is essential when the source and target types have different data models or require normalization.
When routing documents or batches between different [[Content Type]]s, it is common for the source and target data models to have different fields, structures, or validation requirements. The Route activity addresses this challenge by supporting data transformation through the use of [Data Action]]s.
 
Data transformation during routing is a key feature that enables seamless workflow transitions in Grooper. By leveraging Data Actions, you can automate the mapping, normalization, and validation of data as documents move between different Content Types and Batch Processes, ensuring that your workflows remain robust, flexible, and maintainable.
 
==== What Are Data Actions? ====
 
[[Data Action]]s are configurable operations that manipulate, normalize, or validate data within Grooper. They are designed to:
* Assign or transform field values
* Parse and distribute values to other fields
* Copy or move data between elements
* Perform lookups and validations
* Execute custom logic as part of a data processing pipeline
 
Data Actions can be composed into hierarchies, allowing you to build complex, multi-step data transformation and validation logic from simple, focused operations.
 
==== How Data Actions Work in Routing ====
 
When a Route Definition specifies a target [[Content Type]] that differs from the source, you may need to map, convert, or clean up data so it fits the requirements of the new Batch Process. Data Actions are applied during the routing process to perform these transformations automatically.
 
For example, you might:
* Map a ''Customer Name'' field from the source to a ''Client Name'' field in the target
* Normalize phone numbers or dates to a standard format
* Split a full address into separate street, city, and zip code fields
* Validate that required fields are present and correctly formatted
* Copy or merge data from multiple fields into a single target field
 
==== Configuring Data Actions ====
 
Data Actions are typically configured within a [Data Rule](https://help.grooper.com/v2025/help?typeName=Grooper.Core.DataRule), which defines when and how the action is applied. In the context of routing, you can attach Data Rules and their associated Data Actions to the Route Definition, ensuring that data is transformed as part of the routing process.
 
Key configuration steps include:
# '''Define a Data Rule:''' Specify the scope (such as a [[Data Model]], [[Data Section]], or [[Data Table]]) and any trigger conditions.
# '''Add Data Actions:''' Choose one or more Data Actions.
# '''Map Source and Target Fields:''' Use the Data Action’s properties to select which fields to read from and write to, supporting both direct mapping and complex transformations.
# '''Test and Validate:''' Use a Data Viewer to verify that data is correctly transformed during routing.
 
==== Example Scenarios ====
 
* '''Field Mapping:'''  Suppose you are routing invoices from a legacy process to a new process with updated field names. A Data Action can copy the value from ''Old Invoice Number'' to ''Invoice ID'' in the target data model.
 
* '''Data Normalization:'''  If phone numbers are captured in various formats, a Data Action can standardize them (e.g., converting ''(555) 123-4567'' to ''555-123-4567'') before the data enters the new process.
 
* '''Conditional Transformation:'''  Use a Data Rule with a trigger expression to apply a Data Action only when certain conditions are met (e.g., only normalize dates if the ''Country'' field is ''US'').
 
* '''Data Validation:'''  Before routing, a Data Action can check that all required fields are present and set error messages or flags if data is missing or invalid.
 
==== Benefits of Data Transformation During Routing ====
 
* '''Ensures Data Integrity:''' Data is validated and normalized before entering the new process, reducing errors and exceptions.
* '''Supports Evolving Workflows:''' As business requirements change, you can adapt data transformation logic without modifying extraction or classification steps.
* '''Automates Data Mapping:''' Reduces manual intervention and ensures consistent data handling across processes.


== Key Configuration Tips ==
== Key Configuration Tips ==

Latest revision as of 11:46, 29 July 2025

The Route activity in Grooper is a powerful tool for dynamically directing Batches or Batch Folders into specific Batch Processes based on their Content Type and other configurable rules. It enables flexible, rule-based workflow branching, allowing organizations to automate complex document processing scenarios with precision and control.

What is the Route Activity?

The Route activity evaluates the Content Type of each Batch or Batch Folder and applies the first matching routing rule from a user-defined list of Route Definitions. Each Route Definition specifies:

  • The Content Type to match
  • The destination Batch Process
  • Optional conditions using a boolean trigger expression
  • Whether to move or clone the item
  • Data transformation actions (if needed)
  • Whether to start the routed batch paused

This design allows for highly granular control over how documents and batches are dispatched into downstream workflows, supporting both simple and advanced routing scenarios.

What is the Route Activity For?

The Route activity is used to automate the decision-making process for workflow routing in Grooper. Common use cases include:

  • Batch-Level Routing: Direct entire batches to different processes after import or classification.
  • Folder-Level Routing: Route individual folders (documents) within a batch to specialized workflows, such as exception handling or parallel processing.
  • Post-Classification Routing: Send different document types (e.g., invoices, contracts) to their respective Batch Processes after classification.
  • Exception Handling: Route unclassified or exception documents to a dedicated process for manual review.
  • Parallel Processing: Clone documents or batches into multiple workflows for audit, export, or additional processing.

How is the Route Activity Used?

To use the Route activity:

  1. Add the Route activity to a Batch Process Step in your workflow.
  2. Configure the "Routes" property with one or more Route Definitions. Each definition should specify:
    • The Content Type to match (or leave blank for unclassified items)
    • The target Batch Process
    • Optional trigger expressions for advanced conditions
    • Whether to move or clone the item
    • Any data transformation actions needed when routing between different Content Types
    • Whether to start the routed batch paused for review
  3. Order your Route Definitions from most specific to most general, as only the first matching route is applied to each item.
  4. When the Route activity runs, it evaluates each item in scope (batch or folder), applies the first matching route, and moves or clones the item into the target process as configured.

Batch-Level Routing

When routing at the batch level and cloning is disabled, the Route activity leverages the routing functionality of the Batch object. The batch is moved to the target folder, and its routing properties are set to indicate the new process and step. The batch remains in its current state until routing is applied (typically when the batch is resumed or a routing command is executed), enabling seamless workflow transitions without unnecessary data movement.

Data Transformation During Routing

When routing documents or batches between different Content Types, it is common for the source and target data models to have different fields, structures, or validation requirements. The Route activity addresses this challenge by supporting data transformation through the use of [Data Action]]s.

Data transformation during routing is a key feature that enables seamless workflow transitions in Grooper. By leveraging Data Actions, you can automate the mapping, normalization, and validation of data as documents move between different Content Types and Batch Processes, ensuring that your workflows remain robust, flexible, and maintainable.

What Are Data Actions?

Data Actions are configurable operations that manipulate, normalize, or validate data within Grooper. They are designed to:

  • Assign or transform field values
  • Parse and distribute values to other fields
  • Copy or move data between elements
  • Perform lookups and validations
  • Execute custom logic as part of a data processing pipeline

Data Actions can be composed into hierarchies, allowing you to build complex, multi-step data transformation and validation logic from simple, focused operations.

How Data Actions Work in Routing

When a Route Definition specifies a target Content Type that differs from the source, you may need to map, convert, or clean up data so it fits the requirements of the new Batch Process. Data Actions are applied during the routing process to perform these transformations automatically.

For example, you might:

  • Map a Customer Name field from the source to a Client Name field in the target
  • Normalize phone numbers or dates to a standard format
  • Split a full address into separate street, city, and zip code fields
  • Validate that required fields are present and correctly formatted
  • Copy or merge data from multiple fields into a single target field

Configuring Data Actions

Data Actions are typically configured within a [Data Rule](https://help.grooper.com/v2025/help?typeName=Grooper.Core.DataRule), which defines when and how the action is applied. In the context of routing, you can attach Data Rules and their associated Data Actions to the Route Definition, ensuring that data is transformed as part of the routing process.

Key configuration steps include:

  1. Define a Data Rule: Specify the scope (such as a Data Model, Data Section, or Data Table) and any trigger conditions.
  2. Add Data Actions: Choose one or more Data Actions.
  3. Map Source and Target Fields: Use the Data Action’s properties to select which fields to read from and write to, supporting both direct mapping and complex transformations.
  4. Test and Validate: Use a Data Viewer to verify that data is correctly transformed during routing.

Example Scenarios

  • Field Mapping: Suppose you are routing invoices from a legacy process to a new process with updated field names. A Data Action can copy the value from Old Invoice Number to Invoice ID in the target data model.
  • Data Normalization: If phone numbers are captured in various formats, a Data Action can standardize them (e.g., converting (555) 123-4567 to 555-123-4567) before the data enters the new process.
  • Conditional Transformation: Use a Data Rule with a trigger expression to apply a Data Action only when certain conditions are met (e.g., only normalize dates if the Country field is US).
  • Data Validation: Before routing, a Data Action can check that all required fields are present and set error messages or flags if data is missing or invalid.

Benefits of Data Transformation During Routing

  • Ensures Data Integrity: Data is validated and normalized before entering the new process, reducing errors and exceptions.
  • Supports Evolving Workflows: As business requirements change, you can adapt data transformation logic without modifying extraction or classification steps.
  • Automates Data Mapping: Reduces manual intervention and ensures consistent data handling across processes.

Key Configuration Tips

  • Place more specific Route Definitions before general ones to ensure correct routing.
  • Use the "Clone" option to retain originals for compliance or parallel workflows.
  • Use the "Start Paused" option to allow for human review or additional configuration before processing.
  • The Route activity can operate on either Batches or Batch Folders, depending on the processing scope of the step.

How Route Differs from Spawn Batch

While both the Route and Spawn Batch activities are used to direct content into new or different workflows, they serve distinct purposes and operate differently.

  • Spawn Batch is primarily designed for splitting batches based on filtering criteria (such as MIME type, content type, or flag status), and then optionally launching the resulting batches into a process. Its focus is on dividing and distributing content, not on evaluating complex routing rules or conditions.
  • Route is purpose-built for workflow branching. It evaluates each batch or folder against a prioritized list of routing rules, which can include content type, custom conditions, and data transformation actions. Route is designed to automate decision-making and direct content into the correct process based on business logic.
Feature Route Activity Spawn Batch Activity
Purpose Directs batches or folders into specific batch processes based on content type and rules. Splits a batch into one or more new batches by selecting and moving/copying folders based on filters.
Granularity Can operate at the batch or folder level. Operates at the folder level within a batch.
Routing Logic Uses ordered Route Definitions with content type matching and optional trigger expressions. Uses filtering criteria (e.g., MIME type, content type, flag status) and spawn methods (Filter, EveryN, Random).
Action Moves or clones items into a target batch process; can apply data transformations. Copies, moves, or deletes folders; creates new batches and optionally launches them into a process.
Data Transformation Supports mapping or transforming data fields when routing between different content types. Does not perform data transformation; simply moves or copies folders.
Typical Use Cases Workflow branching, exception handling, post-classification routing, parallel processing. Splitting large batches, sampling, distributing work, or reorganizing batch content.

Summary

The Route activity is a flexible, rule-driven tool for automating workflow branching in Grooper. It enables organizations to direct content into the right processes based on document type, business rules, or custom logic, supporting advanced automation and process segmentation. In contrast, the Spawn Batch activity is focused on splitting and distributing batch content, without the rule-based routing or data transformation capabilities of Route.