You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Next »
This is good example how we can Eliminate bottlenecks with IguanaX . This is the problem. A large lab needs to have a file reading component which can feed files from different customers based on prefix of the file, i.e. some files start with JJ333, others XYZ etc. depending on the source.
How can we make a super streamlined component which:
Matches the requirements
Is easy to implement
Simplifies operations
Build a custom configuration
See Custom Fields. We take the base File Reader and add Client ID List which will be a comma delimited list of the prefixes we want to filter on:
We 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 this function to return true when the matching criteria are met.
https://bitbucket.org/interfaceware/fromfile/src/main/MatchRules.lua
--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]
end
Start 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:
function IdList()
local IdList = component.fields()["Client Id List"]
for i = 1, #IdList do
IdList[i] = IdList[i]:trimWS()
end
end
We need to get the list of prefixs
function MatchFile(FileName)
local IdList = component.fields()["Client Id List"]
IdList = IdList:split(",")
local JustFileName = FILfilename(FileName)
for i = 1, #IdList do
trace(IdList[i])
local Id = IdList[i]:trimWS()
local Part = JustFileName:sub(1, #Id)
trace(Id, Part)
if (Part == Id) then return true end
end
end
Make it super simple to see the status
Make the logging really intuitive
Avoid the bottlenecks of waiting on development resources
Now find the next bottleneck, fix it and rinse-repeat