Class Reference
IRIS for UNIX 2024.1.2
InterSystems: The power behind what matters   
Documentation  Search
  [USER] >  [EnsLib] >  [EDI] >  [X12] >  [Operation] >  [FileOperation]
Private  Storage   

class EnsLib.EDI.X12.Operation.FileOperation extends EnsLib.EDI.X12.Operation.BatchStandard

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 1 3


Summary

This is a Business Operation class.

The associated Adapter class is EnsLib.File.OutboundAdapter.

RequestResponse
EnsLib.EDI.X12.Document EnsLib.EDI.X12.Document

Properties
%AlertStartTime %ConfigName %ConfigQueueName %LastActionTime
%LastHandledTime %LastReportedError %QuitTask %RequestHeader
%SessionId %SuperSession %WarnedLatest %isShadow
%outFraming Adapter AlertGroups AlertOnError
AlertRetryGracePeriod ArchiveIO AutoBatchCompletionTimeout AutoBatchParentSegs
BusinessPartner DefCharEncoding DeferResponse FailureTimeout
Filename Framing IOLogEntry InactivityTimeout
NoFailWhileDisconnected QueueCountAlert QueueWaitAlert ReplyCodeActions
Retry RetryCount RetryInterval SearchTableClass
SendSuperSession Separators SuspendMessage ThrottleDelay
Validation

Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsModified %New
%NormalizeObject %ObjectModified %OnClose %OnNew
%OriginalNamespace %PackageName %RemoveFromSaveSet %SerializeObject
%SetModified %SuperSessionSet %ValidateObject AdapterName
AssignOneSetting CloseIOLogEntry DeferResponse EnumerateSettingsClose
EnumerateSettingsExecute EnumerateSettingsFetch GenerateSuperSession GetDeferredResponseToken
GetMessageList GetMsgHdrRequestKey GetProductionSettingValue GetProductionSettings
GetPropertyConnections GetSettings GetShadowInstance IncludeSuperSession
NewIOLogEntry OnError OnFailureTimeout OnGenerateSuperSession
OnGetConnections OnGetReplyAction OnInit OnKeepalive
OnMessage OnMonitor OnProductionStart OnProductionStop
OnTearDown OnValidate OutputFramedToDevice OutputFramedToIOStream
QueueName SaveIOLogEntry SendAlert SendDeferredResponse
SendRequestAsync SendRequestSync SetOutFraming completeUnfinishedBatches
fileExists outputDocument outputHeaders outputSegment
validateAndIndex


Parameters

• parameter ADAPTER = "EnsLib.File.OutboundAdapter";
The type of adapter used to communicate with external systems

Properties

• property Filename as %String(MAXLEN=1000,MINLEN=1) [ InitialExpression = "%f_%Q%!+(_a)",Required ];
Name of file to output the document(s) to.
Consists of literal characters and zero or more format codes. A format code is preceded by a percent sign (%); characters that are not part of a format code are output unchanged.
The %f or %F specifier if present will be replaced with the name of the document's original source stream (stripped of characters illegal in filenames).

Timestamp format codes are documented in the method FormatDateTime() in class Ens.Util.Time
. The additional format code '+' is supported to guarantee filename uniqueness by incrementing a counter string. This additional code is supported in the following forms, where nn is an alphanumeric counter string of 0 or more characters:

  • %+(nn) - Increment nn until the generated filename does not exist in the target directory specified by pDirectory
  • %#+(nn) - Increment nn omitting leading non-significant 0/a characters
  • %!+(nn) - Only use nn if the base filename already exists
  • %#!+(nn) or %!#+(nn) - Omit nn if the filename without it does not exist already, otherwise use nn but omit leading non-significant 0/a characters within it
  • %$+(nn) - increment nn without testing for existence of the resulting filename; then re-increment while the resulting filename exists
  • %#$+(nn) or %$#+(nn) - increment nn regardless without testing for existence, omitting leading non-significant 0/a characters

  • Thus the '#' character means to output only the rightmost significant (non-zero,non- a/A) alphanumeric characters, the '!' means to only use nn if needed to create a unique local filename, and '$' means to increment nn for each call regardless of the local filesystem. The '$' form can be used to generate a series of filenames on a local or remote filesystem. This form relies on a counter variable in $$$EnsStaticAppData("Ens.Util.File:CreateTimestamp").
    The counter string nn may also contain non-alphanumeric characters. If these are present they are output unchanged as literal characters. To ensure a unique filename, first the filename including string nn is checked for existence, and if that already exists the string is incremented in its rightmost alphanumeric character first. Digits are incremented in the range 0-9, and alphabetic characters are incremented in the ranges a-z and A-Z. If the entire range represented by nn is exhausted, additional digits/letters will be prepended as needed.
For example, the string %F_%Q_%!#+(.a1) means the the document's original source stream is used with a timestamp appended, and if a file like that already exists then .1 is further appended, and if that also exists already then .2 is appended, and so on, up to .9, then to .a1, then up to .z9, and beyond that to .az1 and so on. Only one '%+' format code is supported.
The timestamp string used always reflects the current time, converted to the timezone specified using the %K format code.

Methods

• method fileExists(pFilename As %String, ByRef pStatus As %Status = $$$OK) as %Boolean
Implemented by subclasses
• method outputDocument(pFilename As %String, pDocument As EnsLib.EDI.X12.Document, pSeparators As %String, pDoFraming As %Integer) as %Status
• method outputSegment(pFilename As %String, pSegObj As EnsLib.EDI.X12.Segment, pSeparators As %String, pCount As %Integer = 0) as %Status


Copyright (c) 2025 by InterSystems Corporation. Cambridge, Massachusetts, U.S.A. All rights reserved. Confidential property of InterSystems Corporation.