Skip to main content

Rulesets

Overview

The Rulesets feature in FormKiQ serves as a decision-making engine for automated document processing. By defining sets of rules with specific conditions and priorities, organizations can automate workflows, enforce business logic, and ensure compliance standards.

Each ruleset contains individual rules that define specific conditions and corresponding actions. The priority system allows fine-tuning of workflows, ensuring that critical conditions take precedence when multiple rules are applicable.

Components

Ruleset Structure

{
"ruleset": {
"description": "string",
"priority": number,
"version": number,
"status": "ACTIVE" | "INACTIVE"
}
}
ParameterTypeRequiredDescription
descriptionstringNoBrief description of the ruleset's purpose
prioritynumberYesProcessing priority (lower = higher priority)
versionnumberYesRuleset version number
statusstringYesACTIVE or INACTIVE

Rule Structure

{
"rule": {
"priority": number,
"description": "string",
"workflowId": "string",
"status": "ACTIVE" | "INACTIVE",
"conditions": {
"must": [
{
"criterion": "string",
"fieldName": "string",
"value": "string",
"operation": "string"
}
]
}
}
}
ParameterTypeRequiredDescription
prioritynumberYesRule priority within ruleset
descriptionstringNoBrief description of the rule
workflowIdstringYesAssociated workflow identifier
statusstringYesACTIVE or INACTIVE
conditionsobjectYesRule conditions object

Supported Conditions

CriterionSupported FilesOperationsDescription
CONTENT_TYPE*EQ, CONTAINSMatch file types
TEXTapplication/pdf, text/*EQ, CONTAINSSearch document content
BARCODEapplication/pdfEQ, CONTAINSProcess barcode data
FIELDapplication/pdfEQ, CONTAINS, GT, GTE, LT, LTEExtract form fields

Operations

OperationDescriptionExample
EQEqual toMatch specific values
GTGreater thanNumeric comparisons
GTEGreater than or equal toMinimum thresholds
LTLess thanMaximum limits
LTELess than or equal toUpper thresholds
CONTAINSPartial matchFind keywords in text

Practical Examples

1. PDF Processing Ruleset

{
"ruleset": {
"description": "PDF Document Processing",
"priority": 1,
"version": 1,
"status": "ACTIVE"
}
}
{
"rule": {
"priority": 1,
"description": "Process incoming PDFs",
"workflowId": "pdf-workflow",
"status": "ACTIVE",
"conditions": {
"must": [
{
"criterion": "CONTENT_TYPE",
"value": "application/pdf",
"operation": "EQ"
}
]
}
}
}

2. Invoice Processing Ruleset

{
"ruleset": {
"description": "Invoice Processing",
"priority": 2,
"version": 1,
"status": "ACTIVE"
}
}
{
"rule": {
"priority": 1,
"description": "High-value invoice workflow",
"workflowId": "invoice-approval",
"status": "ACTIVE",
"conditions": {
"must": [
{
"criterion": "TEXT",
"value": "INVOICE",
"operation": "CONTAINS"
},
{
"criterion": "FIELD",
"fieldName": "amount",
"value": "10000",
"operation": "GTE"
}
]
}
}
}

3. Shipping Document Ruleset

{
"ruleset": {
"description": "Shipping Document Processing",
"priority": 3,
"version": 1,
"status": "ACTIVE"
}
}
{
"rule": {
"priority": 1,
"description": "Route international shipments",
"workflowId": "international-shipping",
"status": "ACTIVE",
"conditions": {
"must": [
{
"criterion": "BARCODE",
"value": "INT-",
"operation": "CONTAINS"
}
]
}
}
}

Common Use Cases

Document Classification

  • Categorize documents based on content
  • Apply metadata based on rules
  • Route to appropriate workflows
  • Implement content-based policies

Data Extraction

  • Extract key information from forms
  • Process invoice data
  • Capture barcode information
  • Parse structured documents

Validation and Verification

  • Validate document completeness
  • Check required fields
  • Verify calculations
  • Ensure data accuracy

Compliance

  • Flag sensitive information
  • Enforce document policies
  • Maintain audit trails
  • Handle regulatory requirements

Workflow Automation

  • Route based on content
  • Trigger approval processes
  • Automate document processing
  • Manage document lifecycle

Best Practices

  1. Ruleset Organization

    • Use clear, descriptive names
    • Maintain consistent priority schemes
    • Document ruleset purposes
    • Version control for changes
  2. Rule Design

    • Start with specific rules
    • Use appropriate priorities
    • Keep conditions focused
    • Test rule combinations
  3. Performance

    • Minimize condition complexity
    • Optimize priority ordering
    • Monitor execution times
    • Regular rule cleanup
  4. Maintenance

    • Regular rule reviews
    • Update documentation
    • Archive unused rules
    • Test rule changes

Next Steps

For more information about implementing Rulesets: