Replacement For system.IO

Hi,

I am in the process of upgrading our labelling software that generates bar codes for all our serialized units as part of our Kinetic migration.

Previously, I have been using System.IO to generate the file containng the ZPL printer code and then copying the file to our barcode printer.

I works really well and is very quick, which we need for our production volumes (Bartender did not meet our requirements).

I have rewritten the code to use the

> this.CallService<Ice.Contracts.FileTransferSvcContract>(hFileTransfer => {
>                 hFileTransfer.UploadFile

function and the file is generating in the SpecialFolder.UserData as expected.

However, does anyone know of there is there any functionality in the Ice.Contracts.FileTransferSvcContract to copy to a local network drive.

We are on-prem and my contingency is some kind of background process running on the server that copies the files , but ideally, I would like this to be entirely within Epicor.

Any input is appreciated.

Thanks,

Andrew.

Not that I know of.

I honestly don’t like hardcoding file locations in code. At least one upgrade has burned me because someone did, and the network location changed - even got burned when the server moved from a colocation to Azure and the local file system was different.

It really depends on your business problem that you’re trying to solve. What about the current process requires a file written to a specific network location?

I agree about hardcoding.

We store the location in a UD field against the workstation (e.g. BarcodePrinter_c).

The code then looks up the printer assigned to the MES workstation and prints the labels.

Thanks - I’ve added my comments to the idea.

1 Like

Have we considered using the Bartender API to just send the data directly and skip the file system? @Chris_Conn has done some excellent work here and has some demos on the site.

4 Likes

Definitely my goto, run a BAQ, get the data i need, look up the Printer maintenance UNC path for the user selected printer and go to town (or let BT go to town).

I’ve even proven I can hijack SSRS label print requests and convert them to BT calls. Certainly not supported, but doable.

4 Likes

I just looked. No.

But you could transfer to server, then have custom method to copy it to UNC path. More steps than ideal.

If you have the file in user folder calling this gets the meat:

byte[]  DownloadFileForUser(SpecialFolder folder, string serverPath, string userID)

Otherwise:
byte[] DownloadFile(SpecialFolder folder, string serverPath)


SpecialFolders:
SpecialFolder.Attachment
SpecialFolder.CompanyData
SpecialFolder.CustomReportDefinition
SpecialFolder.EWADeployment
SpecialFolder.UserData
SpecialFolder.WebDeployment
SpecialFolder.Report
SpecialFolder.ReportDefinition
2 Likes

@Hally did work on this too.

1 Like

Yes, he did!!!

Delimma is the original requirement, speed. How much overhead would that take? Probably not much. Perhaps using DFS to just copy rather than an custom method.

Ad far as path locations @Mark_Wonsil mentioned, the solution @utaylor was eluding to uses user codes to store this information on a per environment and per label basis so it removes the hard coding aspects.

Hope that helps.

Whilst using the Bartender Rest Api, it would ever as per peeformant as dumping the file directly to the printer. Which sounds like a fun project… :thinking:

Hi,

Thanks for your ideas.

I looked at the DownloadFile option, but couldn’t understand the parameters name.

Where is the actual file name to be downloaded specified?

Cheers,

Andrew.

We looked at Bartender in the past (2016) and it was too slow for our requirements.

It may be worth a revisit, but I am concerned that the solution involves sending data to the API (in the cloud) and then the API contact the Bartender printer locally sounds ‘clunky’.

Unless Epicor relent on this cull then It is looking like some kind of sync software that auto copies files to the printer.

1 Like

While Bartender does have a cloud option, the on-prem version also has an API.

Even without Bartender, whipping up your own minimal API and writing directly to the printer could also work around the file system restrictions.

2 Likes

Agreed - looks like an API approach is the way to go.

It would be really useful if Epicor could give us some clear release schedules (i.e. System.IO will not be available after release ???) so that we know how to prioritise removing calls to System.IO from our functions/ bpms.

1 Like

I’ve got two things I’ll be releasing soon that should address this pretty easily.

A full tool, and an example to roll your own without the tool using the same technologies.

4 Likes
  <businessObject>Ice.Proxy.Lib.FileTransferImpl</businessObject>
  <methodName>DownloadFile</methodName>
  <appServerUri>https://myserver/KineticTest/</appServerUri>
  <returnType>System.Byte[]</returnType>
  <localTime>8/29/2024 07:58:20:1775217</localTime>
  <threadID>62</threadID>
  <correlationId>1621cac7-069f-452c-b1b3-4cc00ccceabb</correlationId>
  <executionTime total="107" roundTrip="106" channel="0" bpm="0" bpmDataForm="0" other="1" />
  <retries>0</retries>
  <parameters>
    <parameter name="folder" type="Epicor.ServiceModel.Utilities.SpecialFolder"><![CDATA[CompanyData]]></parameter>
    <parameter name="serverPath" type="System.String"><![CDATA[Log\Chris.Conn\AUF00000000001-57594036409.log]]></parameter>
  </parameters>
</tracePacket>

Example of "Company" download type
Note Company (as in the folder) is implied by the session
2 Likes

Went into VS - built a wep api project - deployed to the test server - changed the function (http.client) - it works

I feel like I’ve had a glimpse into near past - Apis make so much sense - but I guess that’s why the likes of Epicor (sap, oracle et al) have been doing it for years.

1 Like

Its the way to go for anything remote.

Now if you need to do some fiddling inside the system you’re on…

2 Likes

And APIs all got popular with Jeff.

2 Likes