This Admin Automation option is the recommended way of performing EDI with the RailroadPM system. It mimics the steps that a human user would take to login to the RailroadPM data administration (aka "extranet") website and enter the weekly data. This has the benefit of consistency in the way that the data is accepted and verified by the RailroadPM system.
To use the Admin Automation option for EDI, here are the steps you would follow manually from a command prompt. You can automate the appropriate weekly pieces of this procedure (e.g., copying your weekly data file to the appropriate folder and running the upload script) to make this an unattended process.
-
Clone or download this GitHub repo.
-
Change your current working directory to this
AdminAutomationExamplefolder:cd AdminAutomationExample -
Install Node.js (LTS version 8.x) if it isn't already installed.
-
Run the following command to install the required Node.js NPM packages:
npm install
-
Edit
config.json, replacing the placeholder values with your RailroadPM participant email and password. Save those changes. -
Replace
NewWeek.toml(which is supplied solely as a placeholder here) with the actual weekly data you wish to upload. For each current participating railroad, an example.tomlfile has been supplied in thesample-data-filesfolder. Your weekly file must be in precisely the format you see there, with changes allowed only to the numeric values and to theTitlestring. TheTitlemust be the weekly reporting period end date (a Friday) in the format:'YYYYMMDD'. -
Finally, with your participant credentials configured, and your properly formatted
NewWeek.tomlfile in place, execute the following command:npm run upload
-
You may be asked to allow the process to send traffic through your firewall. If so, allow access.
-
Note the exit code of the process. A non-zero exit code means that an error occurred and the data likely was not uploaded successfully. An exit code of zero indicates success. Sample error and success outputs are provided in the
sample-outputfolder.