User Tools

Site Tools


acq:edi_configuration

This is an old revision of the document!


EDI Install/Configuration

This is a DRAFT document that will be revised as exploration continues.

Install EDI Translator

For Indiana and Bibliomation, we've chosen to run this on our "utility" server as that server is where we also run processes like action/triggers (A/T), notices, etc.

One may start with a fresh checkout of "rel_2_0" branch from the community Git (http://git.evergreen-ils.org/?p=Evergreen.git;a=tree;h=refs/heads/rel_2_0;hb=rel_2_0) as that's the version we're currently running. If you need help with checking out the latest version of the code, please see http://evergreen-ils.org/dokuwiki/doku.php?id=dev:git. Alternatively, the necessary files can be found in the latest tar.gz file of Evergreen releases.

  1. As the opensrf user, copy the EDI Translator code found in Open-ILS/src/edi_translator to somewhere accessible (for example, /openils/var/edi):
    cp -r Open-ILS/src/edi_translator /openils/var/edi
  2. Navigate to where you have saved the code to begin next step.
    cd /openils/var/edi
  3. Next, as the root user (or a user with sudo rights) we need to install the dependencies, via "install.sh". This will perform some apt-get routines to install the code needed for the EDI translator to function. Note: subversion must be installed first. (Suggestion – install.sh should probably be doing an apt-get update first too?):
    ./install.sh
  4. Now, we're ready to start "edi_webrick.bash" which is the script that calls the "Ruby" code to translate EDI. Note: This script needs to be started in order for EDI to function so please take appropriate measures to ensure this starts following reboots/upgrades/etc.
    ./edi_webrick.bash

Using the command "ps aux | grep edi" should show you something similar if the script is running properly:

root 	30349  0.8  0.1  52620 10824 pts/0	S	13:04   0:00 ruby ./edi_webrick.rb

To shutdown EDI Translator you can use something like pkill (assuming no other ruby processes are running):

kill -INT $(pgrep ruby)

The EDI Translator runs on localhost and listens on port 9191 by default. This is controlled via the edi_webrick.cnf file located in the edi_translator directory. It should not be necessary to change this so long as the EDI Translator is running on the same machine as where A/Ts are generated.

EDI Scripts

edi_pusher.pl

As opensrf, copy edi_fetcher.pl and edi_pusher.pl from Open-ILS/src/support-scripts into /openils/bin

edi_pusher.pl is the script that will actually send and receive information between Evergreen and the … client? ordering agency?

Run edi_pusher.pl script regularly to push EDI messages out. This is best configured as a cronjob… for example, this command will run edi_pusher.pl 10 minutes past the hour, every hour:

10 * * * * cd /openils/bin && /usr/bin/perl ./edi_pusher.pl > /dev/null

edi_fetcher.pl

Also run, the edi_fetcher.pl script to pull in new incoming files for EDI accounts:

0 1 * * * cd /openils/bin && /usr/bin/perl ./edi_fetcher.pl > /dev/null

We’re only running it once every night at 1 am while we test the edi_fetcher components. Perhaps this needs to run more regularly depending on the response time of the vendors.

Configuring Providers and EDI Accounts

Providers

Look in Admin > Server Administration > Acquisitions > Providers

Column Description/Notes
Provider Name A unique name to identify the provider
Code A unique code to identify the provider
Owner The org unit who will “own” the provider.
Currency The currency format the provider accepts
Active Whether or not the Provider is “active” for use
Default Claim Policy ??
EDI Default The default “EDI Account” to use (see EDI Accounts Configuration)
Email The email address for the provider
Fax Phone A fax number for the provider
Holdings Tag The holdings tag to be utilized (usually 852, for Evergreen)
Phone A phone number for the provider
Prepayment Required Whether or not prepayment is required
SAN The vendor provided, org unit specific SAN code
URL The vendor website

EDI Accounts

Look in Admin > Server Administration > Acquisitions > EDI Accounts

Column Description/Notes
Label A unique name to identify the provider
Host FTP/SFTP/SSH hostname – vendor assigned
Username FTP/SFTP/SSH username – vendor assigned
Password FTP/SFTP/SSH password – vendor assigned
Account Vendor assigned account number associated with your organization
Owner The organizational unit who owns the EDI account
Last Activity The date of last activity for the account
Provider This is a link to one of the “codes” in the “Providers” interface
Path The path on the vendor’s server where Evergreen will send it’s outgoing .epo files
Incoming Directory The path on the vendor’s server where “incoming” .epo files are stored
Vendor Account Number Vendor assigned account number.
Vendor Assigned Code Usually a sub-account designation. Can be used with or without the Vendor Account Number.

Configuring Organizational Unit SAN code

The admin > Server Settings > Organizational Units interface allows a library to configure their SAN, along side their address, phone, etc.

Some Troubleshooting Notes

Potential Error Messages

If running edi_pusher.pl manually, you should see something like this when there are no POs that are awaiting translation:

opensrf@server:/openils/bin$ ./edi_pusher.pl 
FTP_PASSIVE is OFF

Hook 'acqpo.activated' is used in 1 event definition(s):
 23 - 'PO JEDI'
Event definition 23 has 0 (completed) event(s)

done
opensrf@server:/openils/bin$ 

There may be errors generated that require troubleshooting. For example, an error like this:

ERROR: attempt_translation failed for event 573913, PO 132, template_output 207516

This means you should check the data field from action_trigger.event_output with an ID of 207516. There must be something wrong with the data contained within. Potential problem source may be bad character strings or line breaks in the PO generation itself. See bug ticket where title with quotes fails to properly translate.

Check this bug ticket (fixed in 2.0.9+), if you see this error:

Can't locate object method "is_dir" via package "Net::FTP" at /openils/lib/perl5/OpenILS/Utils/RemoteAccount.pm line 614.

PO JEDI Template Issues

Some libraries may also run into issues with the action/trigger (PO JEDI). The template has to be modified to handle different vendor codes that may be used. For instance, if you use "ingra" instead of INGRAM this may cause a problem because they are hardcoded in the template. The following is an example of one modification that seems to work.

Original template has:

        "buyer":[
            [%   IF   target.provider.edi_default.vendcode && (target.provider.code == 'BT' || target.provider.name.match('(?i)^BAKER & TAYLOR'))  -%]
                {"id-qualifier": 91, "id":"[% target.ordering_agency.mailing_address.san _ ' ' _ target.provider.edi_default.vendcode %]"}
            [%- ELSIF target.provider.edi_default.vendcode && target.provider.code == 'INGRAM' -%]
                {"id":"[% target.ordering_agency.mailing_address.san %]"},
                {"id-qualifier": 91, "id":"[% target.provider.edi_default.vendcode %]"}
            [%- ELSE -%]
                {"id":"[% target.ordering_agency.mailing_address.san %]"}
            [%- END -%]
        ],

modified has the following where it matches on Provide SAN instead of code. More testing should be done but it seems to be working.

        "buyer":[
            [%   IF   target.provider.edi_default.vendcode && (target.provider.san == '1556150')  -%]
                {"id-qualifier": 91, "id":"[% target.ordering_agency.mailing_address.san _ ' ' _ target.provider.edi_default.vendcode %]"}
                {"id-qualifier": 91, "id":"[% target.ordering_agency.mailing_address.san _ ' ' _ target.provider.edi_default.vendcode %]"}
	     [%- ELSIF target.provider.edi_default.vendcode && (target.provider.san == '1697978')  -%]
                {"id":"[% target.ordering_agency.mailing_address.san %]"},
                {"id-qualifier": 91, "id":"[% target.provider.edi_default.vendcode %]"}
            [%- ELSE -%]
                {"id":"[% target.ordering_agency.mailing_address.san %]"}
            [%- END -%]
        ],

acq/edi_configuration.1328720236.txt.gz · Last modified: 2022/02/10 13:33 (external edit)

Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
CC Attribution-Share Alike 4.0 International Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki

© 2008-2022 GPLS and others. Evergreen is open source software, freely licensed under GNU GPLv2 or later.
The Evergreen Project is a U.S. 501(c)3 non-profit organization.