case study ai module integration

AI Module Integration

AI Module Integration: OCR inside PowerBuilder

Document intelligence integrated into PB workflows — mapped into DataWindows for human review.

In this delivered engagement, the client needed faster, more accurate data capture from logistics documents across multiple templates, multilingual data, and handwritten fields. The requirement was strict: integrate AI into the existing PowerBuilder workflow (DataWindows + validations) without breaking user behavior or audit expectations.

The problem

Manual capture couldn’t scale with document variation

The client’s intake process relied on manual data entry from logistics documents. Variation in templates, languages, and handwriting introduced delays and inconsistencies. They needed automation—but not at the cost of control inside the PowerBuilder workflow.

📄 Template diversity

Different document formats and field placements meant brittle rule-based parsing would fail quickly.

🌍 Language + handwriting

Multilingual text and handwriting required document intelligence, not simple OCR-only extraction.

🛡️ Control requirement

Users had to review and correct extracted values before saving—keeping the PB workflow and audit trail intact.

Key constraint: integrate AI extraction into PowerBuilder without bypassing validations, approvals, or the existing DataWindow-based workflow.

The solution

PB stays the workflow engine. AI becomes an API module.

We implemented a dependable pattern: PowerBuilder calls a document intelligence endpoint, receives JSON, and loads results into DataWindows for human review. We prefer an internal gateway so providers can evolve without changing the PB client.

Before
Manual data entry Inconsistent interpretation Slow intake cycles
After
Document AI via API JSON mapped into DataWindows Human review preserved
Control
Confidence + source metadata Exception handling Audit-friendly workflow

🔒 Integration architecture

  • PB → AI Gateway → AI provider (recommended)
  • Centralize authentication, logging, throttling, and provider switching
  • Return DataWindow-friendly JSON arrays wherever possible
  • Include confidence + extraction source for review and exception paths

This pattern keeps the PB client stable even if AI models/providers change.

// Conceptual pattern (illustrative)
httpclient lc = create httpclient
lc.SetRequestHeader("Content-Type", "application/json")
if lc.SendRequest("POST", "https://ai-gateway/api/ocr") = 1 and lc.GetResponseStatusCode() = 200 then
  string ls_json
  lc.GetResponseBody(ls_json)
  // Import into a DataWindow/DataStore once JSON is DW-friendly
  dw_ocr.ImportJson(ls_json)
end if
destroy lc
Result

Automation with governance

The integration improved throughput while keeping decision-making inside the PowerBuilder workflow.

Faster capture

Reduced manual entry by extracting common fields directly from documents and pre-filling DataWindows for review.

Fewer errors

More consistent capture across template types with confidence-driven review and exception workflows.

🧾 Audit-ready

Kept approvals and corrections inside PB, with extraction metadata available for traceability.

Want AI inside your PowerBuilder workflows?
We'll design the API contract, integrate the AI service, and map outputs into DataWindows with human review and audit signals.
📧 pb.solutions@optisol.us 📞 +1 412 406 9010
Or fill out the form — we respond within 1 business day.