Open Exchange
Global Masters
Home / Class Reference / ENSLIB namespace / EnsLib.MFT.Adapter.Inbound
Private  Storage   


class EnsLib.MFT.Adapter.Inbound extends
Ens.InboundAdapter, EnsLib.MFT.Adapter.Common

MFT Inbound Adapter


Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 7 9


%CredentialsObj %WarnedLatest %lastMFTwarning %mftFolders
BusinessHost CallInterval Credentials DeleteFromServer
DownloadItemInfoOnly FilesToRetrieve FindModifiedByUsername IncludeSubFolders
KeepaliveInterval MFTAPIClass MFTConnection MFTConnectionName
MFTSourceFolders RegistryID

%%OIDGet %AddToSaveSet %BindExport %BuildObjectGraph
%ClassIsLatestVersion %ClassName %Close %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IncrementCount %IsA %IsModified
%New %NormalizeObject %ObjectModified %OriginalNamespace
%PackageName %RemoveFromSaveSet %SerializeObject %SetModified
%ValidateObject AssignOneSetting CheckIfProcessItem ClearAllAppData
ClearRuntimeAppData ClearStaticAppData ConstructStreamRequest CredentialsSet
DeleteFile DownloadStream EnumerateSettingsClose EnumerateSettingsExecute
EnumerateSettingsFetch EvalInitialExpression GetFolderContents GetFolderInfo
GetMFTConnection GetRequestId GetSettings GetUsername
HandleMFTError OnInit OnKeepalive OnTask
OnTearDown PostProcess ProcessFolder UploadStream
prodItemIdentifier setMFTFolders


• parameter SETTINGS = "MFTConnectionName:Basic:mftconnectionSelector,MFTSourceFolders:Basic:lookuptableSelector,FilesToRetrieve:Basic,IncludeSubFolders:Basic,DeleteFromServer:Basic,FindModifiedByUsername:Basic,DownloadItemInfoOnly:Basic";
List of properties can be set as settings in the configuration file format is a comma separated list of property names


• property %mftFolders as %String [ MultiDimensional,Transient ];
This is the array of source folders to search in. It is generated from MFTSourceFolders.
The first level subscript can be "Folder" followed by the folder to be searched and the value is the actual folder string used by the API. For example it might be translated to an ID representation.
The first level subscript can be "ID" followed by the ID of the folder and the value is the folder
• property DeleteFromServer as %Integer(DISPLAYLIST=",No,Trash,Permanent",VALUELIST=",0,1,2") [ InitialExpression = 0 ];
Specifies whether or not to delete files on the remote MFT server after successful processing.
The three options are:

No = Do not request any form of delete from the server but record locally that the file has been processed based on file id, its container and modified date so that the file is not reprocessed.
If the modified date changes the file will be processed again.
Note - the local list of processed files will be amended based on the list found on the server.
Files will be removed from the list if they are no longer found on the server and it is possible for this list to keep growing.

The functionality of the following 2 options may be implemented differently or not at all on the remote MFT server:

Trash = Request the MFT server to mark the remote file as deleted but recoverable by manual intervention.

Permanent = Request the MFT server to permanently delete the file.

The Default is No
• property DownloadItemInfoOnly as %Boolean [ InitialExpression = 0 ];
This flag can be set to not download the stream - just the ItemInfo.
• property FilesToRetrieve as %String(MAXLEN=1000);
Regular expression to match against file names to retrieve.
Empty value is the default and means all files.
An example of retrieving only files with extension pdf or jpg case insensitive would be:
(?i) .*\.pdf | .*\.jpg
Where (?i) means case insensitive
.* means any characters
\. means a period
pdf means ends with pdf
| means OR
See documentation on Regular expressions for further information.
• property FindModifiedByUsername as %Boolean [ InitialExpression = 0 ];
Set this to true if a separate call is to be made for each download to find the service's username that modified the document.
• property IncludeSubFolders as %Boolean [ InitialExpression = 0 ];
Specifies if we search through sub folders
• property MFTSourceFolders as %String(MAXLEN="") [ InitialExpression = "/" ];
Name(s) of source MFT Folders to search in.

The name can be one folder or a comma separated list of folders or an @ followed by the name of a Lookup Table.

If @ is the first character and the remainder of the string identifies an existing Lookup Table then the values for all rows in the Lookup Table are used as the MFT Source Folders.
The drop down will list Lookup Tables preceded by a @ for those users with %Ens_LookupTables:READ privilege.

If @ is the first character and the remainder of the string does not identify an existing Lookup Table then the folder name will be taken to be the complete value of the setting including the @ - this is to allow for the possibility that the MFT server supports folder names beginning with @


• method CheckIfProcessItem(pItemInfo As %MFT.ItemInfo, Output pSC As %Status = $$$OK, Output pNotProcessReason As %String = "") as %Boolean
This method is used to check if the item ought to be processed/downloaded.
It checks if the item is a file, has not been processed before and matches the file pattern regular expression.
• method ConstructStreamRequest(pItemInfo As %MFT.ItemInfo, pItemStream As %Stream.Object, pFolder As %String = "", Output pMFTStreamObject As Ens.MFT.StreamContainer) as %Status
This takes the downloaded stream and constructs the MFT Stream request object for the business services.
• method OnInit() as %Status
This user callback method is called just after %OnNew()
• method OnTask() as %Status
default InboundAdapter behavior: always call ProcessInput on CallInterval
• method PostProcess(pProcessInputStatus As %Status, pFileId As %String, pItemInfo As %MFT.ItemInfo) as %Status
This handles ensuring the item is not processed again.
Either by deleting if the DeleteFromServer setting is enabled or by setting in global table.
Files marked as errored are regarded as temporarily errored and can be processed again later when the item is restarted.
• method ProcessFolder(pFolder As %String, ByRef pFolderId As %String, Output pExitReason As %String = "") as %Status
For a given folder on an MFT server process the contents.
pFolderId is passed by reference since may not be defined.
If pFolderIs is passed in as the empty string then it can be changed in this method to the ID of pFolder and this folder id will be used in the request.
• private method cleanDuplicatePreventionTables()
Internal helper method to manage duplicate tables
• method prodItemIdentifier(pItemInfo As %MFT.ItemInfo) as %String
Internal helper method to make subscript identifier by ConfigName, APIClass & File Id that can be used as a subscript
• method setMFTFolders() as %Status