7.4

Table Of Contents
Task Breakdown
l The HTTP Server Input task receives a request through the /getinvoice HTTPAction. Because this task either returns
an HTMLpage with an error message or a PDF, the MIMEtype isAuto-Detect.
l It checks whether the invoice request exists by checking if the size of the file is less than 1kb using File Size Condition.
The condition returns "true"if the file is not found:
c:\planetpress\archives\pdf\invoices\xmlget('/request[-
1]/values[1]/invoicenum[1]',Value,KeepCase,NoTrim).pdf
Here, the xmlget()function grabs the invoicenum variable from the GET request, which would be INV999999.pdf in
the specified folder.
l If the file is not found, then a simple, basic HTMLpage is created indicating the invoice was not found. For this, a Create
File task will suffice, followed by the Delete output task. As we've already mentioned in HTTP Server Workflow, delet-
ing the data file only means you are not doing anything with it locally - it is still returned to the client.
l If, however, the file is found, then it is loaded with the Load External File task, and then deleted (for the same reasons).
HTTP Brochure Request
This workflow builds on the knowledge acquired in HTTP PDF Invoice Request and uses a single process, but in this case it
also uses a PlanetPress Design document which merges the data received from a browser form with the document to generate
a PDFbrochure, which is sent via email.
Resources
l HTTPBrochureRequest.pw7 (PlanetPress Workflow Configuration)
l InformationBrochure.pp7 (PlanetPress Design Document)
Installation
l Download both files
l Open InformationBrochure.pp7 and send it to PlanetPress Workflow.
l Open HTTPBrochureRequest.pw7 and send the configuration to your local PlanetPress Workflow service.
l Open your browser to http://localhost:8080/generatebrochure
Task Breakdown
l The HTTPServer Input receives the initial request from the browser.
l Because this is a demonstration, a backup is made of the XMLrequest. It's not suggested to do this every time, espe-
cially on servers receiving a large number of requests, as these files do take some amount of space for each request.
l Acondition checks whether the form has been submitted, by verifying that one of the required fields is empty. If it is, it
means this is the initial request, so the condition becomes true.
l If this is the initial request, an HTMLpage is created which contains a form asking the client for a required full
name and email, and optional company name. A checkmark also offers to subscribe to a newsletter (it is
unchecked by default!). The form submits back to the same URL, meaning it is handled by the same process.
l The file is renamed with the .html extension, so that both the HTTP service and the browser will recognize it as
an HTMLpage. And then, as usual, it is deleted (but still returned to the browser).
Special Workflow Types