PSI.All Architecture

Technical documentation of PSI’s .NET application codebase (PSI.All) and UniData subroutine architecture. This page maps how applications access data from the AFTEC/UniData database.


Overview

PSI.All is the monorepo containing all PSI .NET applications. These applications access the AFTEC ERP database through multiple methods:

Access MethodLibraryPerformanceUse Case
WCF ServicePSI.DataAccess~5-7 min/projectInteractive apps, debugging
Direct (Legacy)UODOTNET~700 parts/secBatch exports, existing code
Direct (U2 Toolkit)U2.Data.Client~1300 parts/secNew development, production

Database Access Options

WCF Service Layer

Most PSI applications use WCF services through PSI.DataAccess. This provides a stable API but has significant overhead per call.

Direct Database Access

For performance-critical operations, applications can bypass WCF and call UniData subroutines directly. Two libraries are available:

LibraryStatusSpeedNotes
UODOTNET.dllDeprecated~700 parts/secLegacy, via PSI.UniSessionManager
U2.Data.Client.dllActive~1300 parts/secModern U2 Toolkit, recommended

Recommendation: New development should use U2 Toolkit. See U2 Toolkit Migration Guide for details.


Project Inventory

Summary

CategoryCount
Total Projects174
WPF Applications65
Class Libraries64
WCF Services38
Console Applications7

Data Access Patterns

PatternProjectsDescription
UniSessionManager18Direct UniData via UODOTNET (legacy)
U2 Toolkit1Direct UniData via U2.Data.Client (new)
DataAccess (WCF)83WCF service layer
No Database72UI-only or utilities

Key Applications

Direct Database Access

These applications bypass WCF for performance-critical operations:

ApplicationTypeBackendPurpose
PSI.DataExport.CLIConsoleBothBatch data exports (--u2 flag for U2 Toolkit)
PSI.PTIManagerWCF ServiceUODOTNETPart/BOM management
PSI.ServiceWCF ServiceUODOTNETCore data service (26 subroutines)
PSI.UniSessionManagerLibraryUODOTNETUniData connection management
PSI.UniCacheXml.ServiceServiceUODOTNETXML caching layer

WCF Service Layer

Most applications use the WCF service layer through PSI.DataAccess:

ApplicationPurpose
PSI.BOM.ManagerBOM editing and management
PSI.WorkOrderManager.ViewWork order management
PSI.PartMaster.Inquiry.ViewPart lookups
PSI.InventoryManager.ViewInventory tracking
PSI.QuoteManager.ViewQuote management
PTI.BOM.ExplorerBOM visualization

UniData Subroutines

Overview

UniBasic subroutines (VB_*) are stored in pro3prog/VBBASE/ and called from .NET via either:

  • UDSessionController (UODOTNET/legacy)
  • UniSession.CreateUniSubroutine() (U2 Toolkit)
MetricCount
Total VB_ Subroutines370
Referenced by .NET121
Successfully Analyzed119

Subroutines by Functional Area

BOM Operations

SubroutinePurposeUsed By
VB_BOMX.REV1BOM explosion (recursive)PSI.DataExport.CLI
VB_BOMEXPLORER.1.REV3BOM explorer dataPSI.Service
VB_BOMLIST.REV1_DOTNETBOM listingPSI.Shared
VB_BOMNOTROUTED.REV3Unrouted BOM itemsPSI.Shared
VB_IMPORTBOM.REV1BOM importPSI.Shared
VB_JOB_BOM.REV1Job BOM retrievalPSI.Shared

Work Orders

SubroutinePurposeUsed By
VB_WOINQUIRY.1WO inquiryPSI.Service
VB_WOINQUIRY.2WO inquiry (extended)PSI.Service
VB_WOPLAN.REV1WO planningPSI.Service
VB_WORELEASE.REV3WO releasePSI.Service
VB_WO.VERIFY.REV1WO verificationPSI.Service
VB_AUTOWO_CREATE.REV2Auto WO creationPSI.Service

Purchasing

SubroutinePurposeUsed By
VB_POMAINT.REV3PO maintenancePSI.Shared
VB_PORECEIPT.REV2PO receiptPSI.Shared
VB_OPENPOINQ.REV7Open PO inquiryPSI.Shared
VB_POHIST.REV3PO historyPSI.Service
VB_PO.LINE.REV1PO line itemsPSI.Service
VB_VENDORLISTVendor listingPSI.Shared

Parts & Inventory

SubroutinePurposeUsed By
VB_PARTINFO.REV2Part informationPSI.Service
VB_PART_ALLOCATION_INQUIRY.REV6Part allocationPSI.Service
VB_GET.INVENTORYInventory levelsPSI.Service
VB_GET.ITEMHISTItem historyPSI.Service
VB_PRODUCTLIST.REV1Product listingPSI.DataExport.CLI
VB_PRODUCTCLASSLIST.REV1Product classesPSI.DataExport.CLI

Sales Orders

SubroutinePurposeUsed By
VB_SODET.REV4SO detailsPSI.Shared
VB_SHIPTOShip-to addressesPSI.SalesOrderManager
VB_CUSTOMERLIST.REV1Customer listingPSI.Shared
VB_SPQUOTEMAINT2.REV3Quote maintenancePSI.Shared

Engineering & Quality

SubroutinePurposeUsed By
VB_ENGCHG.REV1Engineering changesPSI.Shared
VB_NCN.REV1NCN managementPSI.Shared
VB_PDM.REV2PDM interfacePSI.Shared
VB_REDBOOK.REV1Redbook accessPSI.Shared
VB_ROUTE.REV2RoutingPSI.Service

Data Flow Architecture

WCF Path (Standard)

WPF App → PSI.DataAccess → WCF Service → PSI Local Service
    → UniData Subroutine → AFTEC Database

Each BOM level requires a separate WCF call (100-500ms overhead). A project with 2,000 parts needs 100-200+ sequential calls.

Direct Database Path (Fast)

Legacy (UODOTNET)

CLI/Service → PSI.UniSessionManager → UDSessionController → UODOTNET.dll
    → UniData Subroutine → AFTEC Database
  • Single connection, multiple subroutine calls
  • ~700 parts/second throughput
  • Deprecated but widely used in existing code
CLI/Service → U2.Data.Client.dll → UniSession → CreateUniSubroutine()
    → UniData Subroutine → AFTEC Database
  • Modern, officially supported by Rocket Software
  • ~1300 parts/second throughput (~2x faster)
  • Built-in connection pooling (requires server license)
  • Better .NET Standard 2.0 support

See U2 Toolkit Migration Guide for migration instructions.

Key Dependencies

DLLPurposeLocationStatus
UODOTNET.dllUniData .NET APIPTIManager buildDeprecated
U2.Data.Client.dllU2 Toolkit for .NETRocket Software installActive
PSI.UniSessionManager.dllSession managementPTIManager buildLegacy wrapper
PSI.DataAccess.dllWCF data accessBOM Explorer folderActive
PSI.Common.dllCommon utilitiesBOM Explorer folderActive
PSI.Common.Models.dllCredential encryptionPTIManager buildRequired for U2

UniData Tables

Tables Referenced by Subroutines

Based on subroutine analysis, key UniData tables include:

Table PrefixPurposeExample Files
OPEN.*Open ordersOPEN.ORD.LINE, OPEN.ORD.HEAD
WORK*Work ordersWORKORDER, WORK2470L
PO*Purchase ordersPOFILE, POHIST
INV*InventoryINVFILE, INVTRANS
CUST*CustomersCUSTFILE
VEND*VendorsVENDFILE
PART*PartsPARTFILE, PARTMASTER
BOM*Bills of materialBOMFILE

Dictionary Files

The pro3 account contains 1,428 dictionary files (D_*) defining field structures for each table.


Data Models

Summary

MetricCount
Total Data Models1,834
With [DataContract]383
Implementing IModel8

Key Model Libraries

ProjectModelsPurpose
PSI.Common.ModelsCoreShared data models
PSI.WorkOrder.ModelWOWork order models
PSI.SalesOrder.ModelSOSales order models
PSI.PDM.ModelPDMProduct data models
PSI.Accounting.ModelFinanceAccounting models

CLI Data Export Tool

The PSI Data Export CLI (psi-export.exe) demonstrates all access patterns:

CommandMethodBackendSubroutines Used
bomWCFPSI Local Service(via service)
direct-bomDirectUODOTNET (legacy)VB_BOMX.REV1
direct-bom --u2DirectU2 ToolkitVB_BOMX.REV1
productsDirectUODOTNETVB_PRODUCTLIST.REV1

See CLI Export Tool for full command documentation.

Potential Extensions

Based on available subroutines, additional CLI commands could include:

CommandPrioritySubroutines
direct-partsHighVB_PARTINFO.REV2, VB_PRODUCTLIST.REV1
direct-jobsHighVB_WOINQUIRY.*, VB_JOB_BOM.REV1
direct-inventoryMediumVB_GET.INVENTORY, VB_PART_ALLOCATION_INQUIRY.*
direct-poLowVB_POMAINT., VB_POHIST.


Last updated: February 2025 Source: Automated analysis of PSI.All codebase and UniData sources