Skip to content

Batch address cleanse

Batch address cleanse hands a file path to the CorrectAddress vendor service so it can run a batch cleansing job server-side, then converts the vendor's raw integer return code into a typed BatchReturnTypes value the caller can branch on without memorizing vendor-specific codes.

Field Value
Operation ID OP-CA-02
Trigger Caller invokes clsCleanAddress.RunCleanAddressBatch(inPath)
Inputs inPath — path passed to the vendor batch operation
Outputs clsBatchReturnInfo containing the normalized BatchReturnValue enum and the raw ReturnValue integer
Primary components clsCleanAddress.RunCleanAddressBatch, clsBatchReturnInfo, BatchReturnTypes, CleanAddressSvc.clsCAServices
Entry point Services\SAIF.Services.CleanAddress\clsCleanAddress.vb

Steps

  1. Create a new CleanAddressSvc.clsCAServices proxy instance and set AllowAutoRedirect = True and UseDefaultCredentials = True.
  2. Call RunCleanAddressBatch(inPath, ByRef ReturnCode) on the proxy, passing the caller's file path and receiving the vendor's raw integer return code.
  3. Map the raw return code to the BatchReturnTypes enum according to BR-004:
  4. Any value >= 0 maps to Ok.
  5. -1 maps to iniFileNotFound.
  6. -2 maps to NoValidLicenseKey.
  7. -3 maps to TrialExpired.
  8. Any other value maps to Unknown.
  9. Return a new clsBatchReturnInfo instance populated with both the normalized BatchReturnValue and the untouched raw ReturnValue.

Process flow

The following diagram visualizes this operation's control flow.

flowchart TD
    Start([Caller invokes RunCleanAddressBatch<br>with inPath]) --> Proxy[Create clsCAServices proxy]
    Proxy --> Call[Call vendor RunCleanAddressBatch<br>ByRef ReturnCode]
    Call --> Map{Map ReturnCode}
    Map -->|>= 0| Ok[BatchReturnTypes.Ok]
    Map -->|-1| Ini[BatchReturnTypes.iniFileNotFound]
    Map -->|-2| Lic[BatchReturnTypes.NoValidLicenseKey]
    Map -->|-3| Trial[BatchReturnTypes.TrialExpired]
    Map -->|other| Unk[BatchReturnTypes.Unknown]
    Ok --> Return([Return clsBatchReturnInfo])
    Ini --> Return
    Lic --> Return
    Trial --> Return
    Unk --> Return

Failure and edge-case behavior

  • Return codes outside the four explicitly handled cases map to BatchReturnTypes.Unknown per BR-004; this includes the enum's own sentinel value (-1000000001), which no vendor call is expected to return.*
  • The vendor call is not wrapped in a Try/Catch; a SOAP fault or transport error propagates to the caller unhandled, unlike Address cleanse.*
  • The caller always receives both the normalized enum and the untouched raw return code, so it can fall back to inspecting ReturnValue directly if BatchReturnValue is Unknown.

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts.

Sources

  • Services\SAIF.Services.CleanAddress\clsCleanAddress.vb
  • Services\SAIF.Services.CleanAddress\clsBatchReturnInfo.vb
  • Services\SAIF.Services.CleanAddress\mdlEnums.vb
  • Services\SAIF.Services.CleanAddress\Web References\CleanAddressSvc\Reference.vb