Preparing to receive JSON
After you receive a JSON file, you convert it to XML. How you process the XML files depends on the information in the JSON files and what you want to do with the information.
- Evaluate the JSON files that provide input to the process. Make sure that you understand
what information the files contain and how the information is organized.
If possible, ask the JSON provider for the JSON Schema.
- Decide how to process the XML files that you convert the JSON files into. Ricoh ProcessDirector provides two step templates that manipulate XML:
- A step based on the CreateJobsFromXML step template creates jobs from elements in an XML file that match an XPath expression. The step submits the jobs to a workflow.
- A step based on the ApplyXSLTransform step template transforms XML into a file that specifies the values of Ricoh ProcessDirector job or document properties. The step also transforms XML into another XML format.
For more information, see the related task about preparing to receive XML.
- Decide how to receive JSON files for processing.You can submit JSON files to a hot folder input device or place a JSON file at a location from which the Ricoh ProcessDirector server retrieves it.For example:
- If your JSON file contains multiple orders, and each order contains multiple items, submit the JSON files to a hot folder input device.
- If your JSON file contains a list of book titles and the PDF files required to print each book, place the file at a convenient location. Update the file whenever the book titles and print files change.
- If you submit JSON files to a hot folder, place a step based on the ConvertJSONToXML step template after the SetJobPropsFromTextFile and DetectInputDataStream steps.Use the default values for the JSON input file and XML output file.
- If you place a JSON file at a location from which it is retrieved, place a ConvertJSONToXML step before the first step that processes XML.For example, place the ConvertJSONToXML step before the CreateJobsFromXML or ApplyXSLTransform step.Specify the property values for the step:
- For the JSON input file property, specify the directory path and name of the file with the JSON.
- For the XML output file property, specify the directory path and name of the XML file that you want Ricoh ProcessDirector to create.
- Compare the output file with the input file to see how Ricoh ProcessDirector converted JSON into XML.