Repository navigation
Spooldoc 0.8.0: routes send each document by its fields #178
ronistrom
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Spooldoc 0.8.0 is out. One job can now send each document of a spooled file its own way. Take an invoice spooled file where some customers have an email address and some do not: a lookup reads the address from Db2 for i, the invoices with one go by email, and the rest go to a folder in the IFS. Before, that took two jobs on two output queues or a program change. Nothing breaks: the upgrade is a pull and a restart, and every job delivers as it did.
What changed
Routes. A job's routes are in its Destination step, in order. Each route has conditions on the fields of the document, and one or more destinations. A document takes the first route whose conditions it all matches, and goes to every destination of that route, such as an email to the customer and a copy in an IFS folder. The last route without conditions reads Otherwise and takes every document the routes above do not. There is no "or": another route does that. Routes has the details.
Conditions. A condition reads one field with a single value: a field of the page group such as
pg.email, a column a lookup adds such aspg.customer.EMAIL, or a field of the spooled file such assplf.name. It can check that the field is empty, is not empty, equals a value, is one of a list of values, or matches a regular expression such as^SE-. It compares the value in the data, not the printed text: a number field compares as a number and a date field as a date, so changing the Formats in Settings never sends a document another way.See where each page group goes. The page group stepper is now at the top of the Destination step. It shows the route of each page group, and under it the step says "Page group 3 takes route 1". Why lists, for each route, the conditions that do not match, such as
pg.country is DK, not SE. The email, webhook and SFTP previews follow the stepper. Nothing is sent.A document that takes no route is never dropped. The run delivers the documents that took a route, then fails. The Route step in the job log lists each document that took none, with why each route did not take it, and the spooled file is not held, moved or deleted. Add a route for them, save a version and Retry: only what was not sent goes, since Spooldoc remembers what each destination sent. Retry has the details.
Retry for IFS files. Retry now writes only the files an IFS destination has not written yet, such as "Wrote 1 file to /home/docs/out on ibmi.example.com, 5 were written in run #12". So Add a number never makes a second copy of a file on retry, and Fail the run no longer stops on a file the earlier run wrote. A run that writes to an IFS folder also has a Files written list in the job log, with the path each file got, its size and its status. Files written has the details.
All changes are in the release notes.
Upgrading
Take a
pg_dump, then pullghcr.io/strom-capital/spooldoc:0.8.0and start it. The server applies the new migration. Nothing else needs you.Tell us
Questions go to Q&A, ideas to Ideas, bugs to the issues. We most want to hear how you split a spooled file: the fields your routes read, and a document that went another way than you expected. Replace real library, host and customer names before you paste it.
All reactions