HTTP Server Input
HTTP Server input tasks are used to receive HTTP requests made via GET or POST commands and to send replies to the servers from which the requests were made. The HTTP server supports both http and https. For HTTPS Support information, see HTTP Server Input User Options.
While you can insert the HTTP Server Input Task anywhere in your process as a secondary input task, in reality the HTTP Server Input Task will only function when used as the initial input, as it is triggered when PlanetPress Workflow HTTP Server receives a request and passes it on to the correct task.
Input
The HTTP Server Input task does not, by itself, capture any files. Neither does it directly wait for requests to be received. Actually, it is the HTTP service that receives the requests and places them in a specific location on the drive. When a request is received, the HTTP Server Input polls that location and finds the requests and all attachments. It will always pick up the "oldest" request received.
The request can contain one or more files, one being an XML file containing the request information as well as any GET or POST variables that were received within this request. Other files are POST attachments.
Processing
Depending on the options chosen in the HTTP Server Input task properties, the task may choose to ignore some of the files. For example, using the "Do not include XML envelope" means that only the POST attachments will be used in the process, the XML file will be discarded. Attachments are always saved on disk in a specific location, which is accessible either directly in the XML or directly as a data file through the "Loop each attachment as data file" option.
Output
First, the output inside the process itself is, depending on the selected options, an XML request files, POST Attachments files, either one or both.
If the "Send Immediate Response to client" option is selected, the response file is sent back right away and the involvement of the input task ends then. However, if this option is not checked, it means there is a second output that comes out of the HTTP Server Input task: The last output generated by PlanetPwress Watch is sent back to the initial input, which is returned back to the client.
Starting in version 7.2 of PlanetPress Suite, you can now serve static resources through PlanetPress, which is especially useful for images, CSS and Javascript files. See HTTP Server Input 2 User Options.
HTTP Server input task properties are as follows:
- HTTP action: Enter the name of the action requested of PlanetPress Suite Workflow Tools by the client. This name corresponds to the URL that the client will be accessing. For example, if you enter "MakePDF" here, you could trigger the process by accessing http://127.0.0.1:8080/MakePDF . This is also what your HTML Form's action should be.
- MIME Type: Select the MIME type that best suits the files PlanetPress Suite Workflow Tools will be receiving as input.
- Loop each attachment as a data file: When receiving attachments through a POST request (HTML Form), this option will make the HTTP Server Input task loop through each attachment. Each data file is an XML with the accompanied file.
- Do not include XML envelope: Only active when the previous Loop option is checked. When checked, the XML file containing the request data will not be available. Only the attachment itself is sent as a data file.
- Respond on error: Enter a message to be sent to the client as the output file if the process encounters an error and is unable to send a reply that includes the actual output file. The information can be in any desired format such as HTML or plain text, but most browsers will interpret it as plain text.
- Send immediate response to client: Do not wait for the process to finish and send a static HTML or Text file back to the client instead. This prevents any timeout from occurring. When checking this option, the field under the option is used to select which file to return.
- Use custom HTTP server response code: When the process ends and a response is sent to the requesting client, a custom response code can be specified depending on how the process goes. While in previous versions the "200 OK" code was always used, this option overrides it to, for example, "404 Not Found" or "401 Unauthorized".
- Variable containing the response code: The contents of the job information or local variable selected in this drop-down, presumed to be a valid response code, will be returned in the response header. This is the value that is present at the end of the process, not the beginning.
"Other" Tab
- Job Information group
- Information elements: indicates what job infos are automatically created by the input task.
- Add lines before first data page: Using the arrows keys you can add any job information directly at the beginning of your data file.
- Backup input files: Check this to save a copy of each data file that is captured by your input. These files are saved in the PlanetPress Suite Workflow Tools working folders under the "Backup" folder.
- Backup filename: Enter the filename that you wish the input data file backup to be saved under.
- Delete Existing Metadata: Check to remove any metadata from memory. This option is disabled on initial input tasks, and is checked by default on secondary input tasks.
Examples & Use Cases
This task is put into effect in the following use cases and example processes:
On Error Tab
By default, any action task, branch, splitter or condition that generates an error will simply be ignored, and the task just under it (not within a branch) will be given control of the job file without any modification. Any initial input task that generates an error will stop the process from running as a whole, and output tasks will not generate output. The On Error tab can be used to overwrite the default behaviors.
- Send to Process: Check this option to send the job file to an error management process.
- Error Process drop-down: Enabled only when the Send to Process option is checked. Lists any process of which the initial input task is the Input Error Bin task.
- Action Group: This group is disabled in the initial input tasks and defaults to Stop Process. In all other tasks where the On Error tab is present, the following options are available:
- Ignore: The task is ignored as if it did not exist, and the job file is passed on to the next task in the process.
- Stop Branch: If the task is in a branch of the process, the branch is stopped and the job file is returned to the process after the branch. The branch will not produce any output.
- Stop Process: The process is stopped and no more processing is done. No further output is produced.
- Log Message: Check this option to enable logging a custom error message in the PlanetPress Suite Workflow Tools' log file.
- Message: Enabled only when the Log Message option is checked. Enter a message that will be logged in the PlanetPress Suite Workflow Tools' log file. You can use any variables available in PlanetPress Workflow to customize the message.
- Store the message in variable: Select in which jobinfo, local or global variable you want to store the message content.
- ID: Enter an error ID. This ID will be visible in the Windows Event Viewer. However, the ID is not visible in the PlanetPress Suite Workflow Tools' log file.
- Store the ID in variable: Select in which jobinfo, local or global variable you want to store the error ID.
- Reset to defaults: Resets all options in this tab to their default values.
If storing the message or ID, if they are store in a jobinfo they will be available in any error handling process where errors are being forwarded. In all cases, if your process continues after the error, the contents of the variables selected in this window will be available for the rest of your process, or whenever they are overwritten.
Common Errors
Though some error messages are specific to a task in particular, others may apply to any and all tasks because they are related more to the system than to PlanetPress itself. Some examples would be W3813, W3830, W3991, W4005. These correspond to issues such as not having any space to write files, permission errors on folders or files, etc.
Comments Tab
The Comments tab, added in PlanetPress Suite 7.5, is common to all tasks. It contains a single text area (Task comments) that lets you write comments about the task. These comments are saved when the dialog is closed with the OK button, and are displayed in The Task Comments Pane.