Unit 2 - Notes
INT346
Unit 2: Advanced Task Bot, Meta Bots, and IQ Bots
1. Advanced Task Bot Operations
Task Bots are the core execution units in RPA, responsible for front-end automation. Advanced operations involve complex logic, data manipulation, and robust system integration.
Task Bot Commands
A. Loops
Loops enable a bot to repeat a set of actions until a specific condition is met. They are essential for batch processing.
- Types of Loops:
- Times Loop: Repeats a sequence a fixed number of times.
- List Loop: Iterates through items in a list variable.
- Excel/CSV Loop: Iterates through rows in a spreadsheet (Row-by-Row).
- Files in Folder: Iterates through file objects within a specific directory.
- Condition-Based Loop (While): Continues looping as long as a condition (e.g., "Window exists") returns true.
- Loop Control:
Break: Immediately exits the loop.Continue: Skips the current iteration and jumps to the next one.
B. Conditionals (Logic)
Conditionals allow the bot to make decisions based on dynamic data or system states.
- If/Else/Else If:
- Variable Comparison: Checks if a variable matches a value, string, or another variable.
- Window Exist: Checks if a specific application window is open.
- Object Properties: Checks if a specific UI element (button, textbox) is enabled or visible.
- File Exist: Verifies the presence of a file before attempting to open it.
- Error Handling (Try/Catch): A specialized conditional structure used to catch runtime errors without crashing the bot.
C. String Operations
Data extracted from applications often requires formatting before entry into another system.
- Common Commands:
- Before/After: Extracts text preceding or succeeding a specific delimiter.
- Substring: Extracts a portion of the string based on start index and length.
- Find/Replace: Locates specific characters and replaces them (e.g., removing commas from currency fields).
- Split: Divides a string into a List variable based on a delimiter (e.g., splitting a full name into First and Last).
- Trim: Removes leading and trailing whitespace.
- Length: Returns the character count of a string.
D. File and Folder Operations
Robots frequently manage the file system to organize inputs and outputs.
- Operations:
- Create/Delete: Managing directories and files.
- Copy/Move: Transferring files from local drives to network shares.
- Rename: Standardizing file naming conventions (e.g., adding timestamps).
- Zip/Unzip: Compressing or extracting files for email attachments or archiving.
- Print Document: Sending files directly to default printers.
Variables: Types, Management, and Best Practices
Variables are storage containers used to hold data dynamically during bot execution.
A. Variable Types
- System Variables: Pre-defined by the RPA platform (e.g.,
,,). Read-only. - User-Defined Variables: Created by the developer.
- Value (String/Number/Boolean): Holds a single data point.
- List (Array): Holds a collection of values (indexed).
- Dictionary: Key-Value pairs.
- Record (Row): Holds a single row of data (usually from a database or Excel loop).
- Window: Holds the handle/properties of an application window.
B. Creation and Usage
- Initialization: Defining the variable and assigning a default value.
- Assignment: Using the "Variable Operation" command to change the value during runtime.
- Scope:
- Local: Accessible only within the current task.
- Global/Input-Output: Accessible across main tasks and sub-tasks.
C. Management Best Practices
- Naming Conventions (Hungarian Notation): Prefix variables to indicate type.
vorsfor String (e.g.,vCustomerName)nfor Number (e.g.,nInvoiceAmount)lstfor List (e.g.,lstEmails)dfor Dictionary
- Clear Sensitive Data: Always use "Credential Variables" (from the Control Room/Orchestrator vault) for passwords, never hardcode plain text.
- Initialization Checks: Ensure variables are cleared or reset at the start of loops to prevent data bleeding from previous iterations.
- Comment Logs: Log variable values during key steps for easier debugging.
Application Integration
Task Bots integrate with applications primarily through the UI, but advanced integration uses APIs and scripting.
- Object Cloning / Object Search: Identifies specific UI elements (HTML tags, Windows Accessibilities) rather than coordinates.
- Recorders:
- Smart Recorder: Captures technology-specific properties (Web vs. Desktop).
- Screen Recorder: Captures coordinate-based clicks (least reliable).
- Scripting Integration: Running Python, VBScript, or JavaScript within the bot to perform complex calculations or backend operations.
- Database Commands: Direct SQL execution (Select, Insert, Update, Delete) bypassing the UI layer.
2. Meta Bots
Meta Bots represent a higher level of automation modularity. Unlike Task Bots which rely heavily on screen recording, Meta Bots rely on API-level integration and visual captures (Assets) to create reusable components.
Overview
- Definition: An automation building block that performs a specific function or interacts with a specific application.
- Key Characteristic: "Build once, use everywhere." If an application interface changes, you update the Meta Bot once, and all Task Bots using it are automatically updated.
- Methods of Integration:
- DLLs (Dynamic Link Libraries): Direct code integration.
- Visual Captures: Screen captures of the target application.
Meta Bot Designer Architecture
The Designer environment typically consists of two main views:
- Assets (Screen/DLL View):
- Captures the screens of the application.
- Imports DLLs for backend logic.
- Logic (Flow View):
- Defines the functions (Logic) that can be performed on the Assets.
- Example: A Logic named "Login" utilizes the "Username" and "Password" fields captured in the Assets view.
Reusability and Modularity
- Black Box Execution: Task Bots call a Meta Bot and pass input variables. The Meta Bot executes the logic and returns output variables. The Task Bot does not need to know how the Meta Bot works.
- Scalability: Libraries of Meta Bots can be created for common applications (e.g., a "Salesforce Meta Bot" or "SAP Meta Bot").
- Maintenance: significantly reduces maintenance time. Instead of fixing 50 Task Bots when a login screen changes, developers fix 1 Meta Bot.
3. IQ Bots (Cognitive Automation)
IQ Bots (Intelligent Bots) combine RPA with AI technologies, specifically Computer Vision, NLP (Natural Language Processing), and Machine Learning, to process semi-structured and unstructured data.
Overview and Capabilities
- Problem Solved: Standard RPA fails when document formats vary (e.g., invoices from different vendors). IQ Bot solves this.
- Core Technology: Cognitive automation that digitizes dark data.
- Capabilities:
- Reading varied formats (PDF, TIFF, JPG, PNG).
- Understanding context (fuzzy logic).
- Self-learning (improves over time with human feedback).
Use Cases
- Invoice Processing: Extracting Invoice Number, Date, Total, and Line Items from thousands of different vendor layouts.
- KYC (Know Your Customer): Extracting data from ID cards, Passports, and Utility Bills.
- Insurance Claims: Processing claim forms and medical reports.
- Mortgage Origination: Extracting data from bank statements and tax documents.
Features and Workflow
- Document Classification: Automatically identifying what type of document was uploaded (e.g., separating an Invoice from a Purchase Order).
- Data Extraction: Using OCR (Optical Character Recognition) and AI to pull specific fields.
- Validation: Applying rules to ensure data quality (e.g., Date must be in DD/MM/YYYY format).
Document Training
Training an IQ Bot is different from coding a Task Bot.
- Upload Samples: Upload sample documents to create a "Learning Instance."
- Grouping: The bot analyzes the visual structure and groups similar documents (e.g., all invoices from Vendor A are Group 1).
- Mapping: The developer (or SME) highlights the data fields on the first document of a group (mapping "Total" to the value "$500.00").
- Bot Learning: The bot applies this logic to all other documents in that group.
Accuracy Improvement (Human-in-the-Loop)
- STP (Straight Through Processing): When the bot extracts data with a confidence level above the threshold (e.g., >80%), it proceeds automatically.
- Validator: If the confidence is low (or a validation rule fails), the document is flagged for human review.
- Learning: When a human corrects the bot in the Validator, the bot learns from this correction, improving accuracy for future documents of that type.
Error Handling
- Unclassified Documents: Documents that do not match any known group are sent to a special folder for manual review or new group creation.
- Missing Fields: If a mandatory field is empty, the bot triggers an exception.
- Format Errors: If data types do not match (e.g., letters in a numeric field), the item is flagged.
Deployment Best Practices
- Staging Environment: Train and test learning instances in a staging environment first.
- Volume Ramp-up: Start with a small volume of documents to verify accuracy before full-scale deployment.
- Feedback Loop: Regularly review the "Validator" statistics to identify which vendors or document layouts are causing the most errors.
- Retraining: Periodically retrain the bot if document formats change drastically.