Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Expand
titleWe need to modify the matching algorithm - what do we start with?

The original file reader component is deliberately simple and uses /wiki/spaces/IXB/pages/3181903910 to make it more obvious how to modify the code to meet new needs. So this is what we are starting off with. We need this function to return true when the matching criteria are met.

https://bitbucket.org/interfaceware/fromfile/src/main/MatchRules.lua

Code Block
--What file extensions do we match?
local FileExtensionMatchSet={
   txt=true,
   log=true,
   hl7=true
}

function MatchFile(FileName)
   --local JustFileName = FILfilename(FileName)
   local Extn = FILextension(FileName)
   Extn = Extn:lower()
   return FileExtensionMatchSet[Extn]return true
end
Expand
titleStart the new MatchFile logic with getting the list of prefixes and removing white space

We’ll apply /wiki/spaces/IXB/pages/3181903910 and write this as a function:

Code Block
function APPidList()
   local IdList = component.fields()["Client Id List"]
   IdList = IdList:split(",")
   for i = 1, #IdList do
      IdList[i] = IdList[i]:trimWS()
   end
end

function MatchFile(FileName)
   local IdList = APPidList();
   return true
end

These are the concepts we have used:

...