Run the example using the Swagger interface
To run the example, deploy to tx-rest and run it using the Swagger interface.
- Create a Web type server definition where the runtime tx-rest is installed if you do not have a server definition to deploy in Design Server.
-
If not running, start tx-rest on the server:
<DTX_HOME>/restapi/tomcat/dtxtomcat start tx-rest
- Deploy the created package to the server definition in Design Server.
-
Bring up the tx-rest Swagger UI:
<DTX_HOME>/restapi/tomcat/dtxtomcat showdocs tx-rest
-
In the Swagger Explore window, enter /tx-rest/v2/docs
and click on the Explore button to view the deployed package.
You can see a Miscellaneous section having two actions:
-
PUT /v2/run/t2_coco_validation_flow
-
POST /v2/run/t2_coco_validation_flow
-
-
In the PUT action:
- Expand the PUT action and select the Try it out button.
- Leave the input and output sections empty.
-
Under flow_vars section, delete the entire content
and replace with the commands to run the flow, for example:
{ "INPUT_FILE": "C:/mydir/data/t2coco_camt_009.xml", "OUTPUT_RESULT_JSON": "C:/mydir/data/validation_result.json", "REPORT_FORMAT": "json", "VALIDATION_TYPE": "extended" }
or
{ "INPUT_FILE": "C:/mydir/data/t2coco_camt_009.xml", "OUTPUT_RESULT_XML": "C:/mydir/data/validation_result.xml", "REPORT_FORMAT": "xml", "VALIDATION_TYPE": "extended" }
-
Click Execute blue bar for running the flow.
When flow completes execution, 200 response code is shown in the Server Response section. This run should generate the output same as above.
-
To delete the deployed package, refresh the browser to get the
Swagger and explore back to
/tx-rest/openapi.json.
There will be a DELETE /v2/packages/{name} action.
- Expand the DELETE /v2/packages/{name} action and select Try it out.
- In the Name field, enter the name you gave to the created package.
-
Select the true from the stop query drop
down, then select the blue Execute bar.
You can see a response of 204 with a timestamp, if it is successful.