Add Scans (To be removed)
Description
The Add Scans screen is where users scan items within a zone session. The system uses a configurable scan flow with multiple steps, each representing a field to be scanned or entered. Each step validates input against regex patterns, performs database matching to verify items exist, and can auto-populate related fields from match results. Steps progress sequentially, with visibility and editability controlled by field rules based on previous inputs. When all required fields are filled and validated, the scan is submitted to the session.
Scan Flow Steps
Each scan flow step has the following properties:
Step Properties
- Display Name: The label shown to the user for this step.
- Value DB Field Name: The database field this step populates (e.g., Barcode, LocationCode, Count).
- Order: The sequence position of this step in the flow.
- Is Visible: Whether the step is shown (can be controlled by visibility rules).
- Value Scannable: Whether this field accepts barcode scanner input.
- Value Allow Manual Input: Whether users can type values instead of scanning.
- Value Remember: Whether to retain the value for the next scan.
- Value Default Value: Pre-filled value when starting a new scan.
- Enable Scanner For Confirmation: Requires scanning the same value twice to confirm.
Validation Properties
- Value Regular Expressions: List of regex patterns to validate input.
- Expression: The regex pattern to match against.
- Invert: If true, input must NOT match the pattern.
- No Match Message: Error message shown when validation fails.
- Allow No Match: If true, user can proceed despite validation failure with confirmation.
- Execution Rules: Conditions that determine if this validation applies.
Matching Properties
- Match Type: The database table type to query for matches.
- Match Result Field Names: Comma-separated list of fields to retrieve from the match database.
- Match Display Result Field Name: The field from match results to display to the user.
- Match Notify Not Matched: Show dialog when no match found.
- Match Allow Not Matched: Allow proceeding without a match (requires confirmation if Match Notify Not Matched is true).
Custom Barcode Properties
- Custom Barcodes: Rules for extracting multiple field values from a single barcode scan.
- RegEx: Pattern to identify barcodes this rule applies to.
- RegEx Inverse: If true, applies when pattern does NOT match.
- Barcode Parts: List of substring extractions from the barcode.
- Start Index: Character position to start extraction.
- Length: Number of characters to extract.
- Result DB Field: Which field to populate with this substring.
- Barcode Operations: String transformations to apply to the extracted value.
- New Zone: If true, scanning this barcode triggers a zone switch.
Field Rules
-
Visibility Rules: Conditions that control whether this step is shown.
- Operator: Comparison operator (e.g., equals, contains).
- DB Field Name: The field to check the condition against.
- RegEx: Pattern to match against the field value.
- Key Code: Hardware button code that triggers the rule.
-
Editable Rules: Conditions that control whether this step can be modified.
- Same properties as Visibility Rules.
Match Process
When a scannable field is submitted, the system:
- Applies Custom Barcode Rules: Extracts additional field values if the barcode matches custom barcode patterns.
- Queries Match Database: Searches the configured match database table using the scanned value as the match code.
- Validates Match Result: Checks if a match was found and validates against zone-specific rules (e.g., LocationCode must match current zone).
- Populates Fields: Auto-fills related fields with data from the match result.
- Handles Alternate Match Codes: If multiple matches exist, shows a selection dialog.
- Validates Empty Fields: Ensures all required fields are populated before final submission.
SubmitOpenScanProperty Process
This is the core function for submitting each step's value:
- Clears Properties: Optionally resets the open scan if starting fresh.
- Gets Open Scan: Retrieves the current in-progress scan from the session.
- Applies Custom Barcodes: Extracts additional fields from the scanned value.
- Executes Match: Queries the match database for the scanned value.
- Validates Match: Throws MatchFailedException if match is required but not found.
- Validates Alternate Match Codes: Filters alternate matches to only valid options.
- Merges Properties: Combines submitted value, match data, and custom barcode extractions.
- Filters Properties: Only includes properties for completed steps (based on step order).
- Updates Scan Source: Records whether the value was scanned or manually entered.
- Saves Open Scan: Persists the updated scan with new properties.
- Sends Feedback: Provides haptic/audio feedback to the scanner device.
Fields
No direct input fields - the scan flow is dynamically generated based on configuration.
Error Messages
- MatchFailedException: The scanned item was not found in the match database.
- Invalid zone format: The scanned zone code does not match the expected pattern for zone switches.
- Count must be a number: The count field contains non-numeric characters.
- StepNotFoundException: A referenced scan flow step does not exist.
- AddScanSessionNotInitialized: No active scanning session found.
- OpenScanNotInitialized: No open scan in progress to submit properties to.
- [Custom Validation Message]: Field-specific error from regex validation with custom message.
- Zone code mismatch: The scanned location belongs to a different zone than the current session.