2021.1

Table Of Contents
Subsequently, the Metadata Sequencer task creates a loop; the rest of the process is
performed as many times as there are records in the Metadata, for one record at a time:
l The Set Job Infos and Variables task reads data from the (current record in the)
Metadata and puts them into variables.
l The Create Web Content task merges the record with the COTG Timesheet Form
template.
l The Send to Folder task saves the form to the Forms folder in the project folder, using the
value of one variable as the file name.
l Finally, the Output to Capture OnTheGo task sends information about the form to the
COTG Server. Double-click the task to see how variables are used in its settings.
The Delete task is an Output task that does nothing, actually; it doesn't even remove anything.
However, this step is useful when running the project step by step in Debug mode. Tasks will
only return their output to the process - where it can be viewed - as long as they are followed by
another task.
Serving a form
When the user chooses to download a form in the app, the app sends a request using the URL
that was set for the form in the properties of the Output to Capture OnTheGo task (on the
Deposit tab). The URL contains one parameter: a unique ID.
The cotg_ts_serve_form process receives the request and loads the form (if it exists). The
Load External File task replaces the job file with the form. At the end of the process the Server
Input task returns the job file (the form) to the app.
Capturing data and generating output
When the user submits a form, the cotg_ts_capture_data process writes the job file - the
request in the form of XML - to a Temp folder in the Workspace and sends a response code to
the app. This way there is no need for the COTG user to wait while output is being generated.
The response to the app can be sent right away.
The cotg_ts_generate_report process picks up the XML file from the Temp folder, converts it
to JSON and saves it to a JSON file. Note how the Branch task keeps a backup of the job file. It
is the backup file - the XML - that is handed down to the next Branch, where it is saved as an
XML file.
Finally, the process extracts data from the job file and merges them with the COTG Timesheet
Report template, generating a PDF.
All output files are stored in the Workspace\Out folder
Page 151