Transform and map
XML order → JSON response
Your first complete integration: validate an XML order, transform it in a reusable subprocess, route with XPath and return a JSON response. Try success and two failure paths.
Last verified 2026-10-31 at f4ce7d0 — simulation fixtures
Studio activation is a one-time payment of USD 20.
Flow
Drawn at build time from the node positions in the template's process definitions. Numbered markers are the walkthrough stages.
Scroll sideways to see the whole flow.
List the 8 activities and 9 transitions
Activities
- Receive request
start - Normalize order
call_process - Validate total
choice - Accept order
assign - Invalid total
raise_error - Render JSON
json.render - Build error response
assign - Return response
end
Transitions
- Receive request → Normalize order (on success)
- Normalize order → Validate total (on success)
- Validate total → Accept order (condition: Valid order)
- Validate total → Invalid total (otherwise: Otherwise)
- Accept order → Render JSON (on success)
- Render JSON → Return response (on success)
- Normalize order → Build error response (on error: Transform error)
- Invalid total → Build error response (on error: Business fault)
- Build error response → Return response (on success)
Scroll sideways to see the whole flow.
List the 7 activities and 6 transitions
Activities
- Start
start - Parse order XML
xml.parse - Validate order XSD
xml.validate - Normalize with XSLT
xml.xslt - Parse normalized XML
xml.parse - Map to JSON object
assign - Return order
end
Transitions
- Start → Parse order XML (on success)
- Parse order XML → Validate order XSD (on success)
- Validate order XSD → Normalize with XSLT (on success)
- Normalize with XSLT → Parse normalized XML (on success)
- Parse normalized XML → Map to JSON object (on success)
- Map to JSON object → Return order (on success)
Walkthrough
- Receive an XML orderThe sample input contains a realistic order with a customer, amount and currency.
- Normalize in a subprocessParse XML, validate its XSD, apply XSLT and map the result.
- Choose the business routeOnly positive order totals follow the accepted branch.
- Inspect the resultCompare the captured response and the assertions in Test & trace.
What you will practise
- Follow the call from the parent into its own reusable subprocess.
- Inspect schema validation, XSLT transformation and XPath routing.
- Compare a valid order with malformed XML and a business-rule rejection.
Sample cases
3 cases with 15 assertions, run with python -m server.integration examples --all in simulation.
Valid order
PassedAn order for EUR 249.90 should be accepted.
Expected result A rendered JSON response with accepted: true and order ORD-1042, EUR 249.90.
6/6 assertions
- Process completes in simulation
- The order is accepted
- Amount remains numeric
- Currency is preserved
- XSLT subprocess executed
- Error handler was not used
This sample run only; not a production certification.
Negative total
PassedChange the amount to -2 and follow the Otherwise/error branch.
Expected result A handled rejection with accepted: false and error code invalid_order_total.
5/5 assertions
- Process completes in simulation
- The order is rejected
- Business fault is explicit
- Error was handled
- Accepted branch was skipped
This sample run only; not a production certification.
Malformed XML
PassedInvalid XML fails inside the child and is handled by the parent.
Expected result A handled parse failure, not an accepted order.
4/4 assertions
- Process completes in simulation
- The order is rejected
- Subprocess error was caught
- XSLT was not attempted
This sample run only; not a production certification.
Prerequisites
- Runtime
- Cohuno runtime 1.27.0, the version recorded when these cases last passed.
- Starter
- Manual start; no listener.
- Optional dependencies
- None beyond the base runtime.
- Simulation fixtures
- None: no activity in this template uses a connector.
Verification details
Provenance
What was verified, and when. The content part changes whenever the pack, a process in its closure, the runtime version or a case result changes; the gallery check then fails until the gallery is regenerated and the changed templates are verified again.
Verified content
- Pack SHA-256
35a9b463c23b5772c7d1e5e9904b2e9786887373e7da57f1a257c53f78087b18- Closure SHA-256
b7fdf485cb3f7b6709aca580b708638f9307bccb57d8a5ba68a2e7220b2079c5- Runtime
1.27.0- Results
- 3/3 cases, 15/15 assertions, mode simulate, external calls: none.
- Files in the closure
server/integration/example_packs/order_to_json.jsonserver/integration/templates/normalize_order.jsonserver/integration/templates/order_intake.json
Verification event
- Commit
f4ce7d08eedc90267b405ed1974344153a8b3a34- Verified at (UTC)
2026-10-31T21:19:21Z
How the Cohuno team reproduces this check
PYTHONPATH=. python -m server.integration examples --example order_to_json PYTHONPATH=. python scripts/export_public_gallery.py --check