Resources

OpenShift Credentials

  • username: username
  • password: user-password

Dev Spaces

Developer Console

Matrix

Rocket.Chat

BGCreated with Sketch.

Tasks to complete

Get Started
BGCreated with Sketch.

Congratulations!

Return to the dashboard to continue your journey.

Go to home

Flow Implementation

Now that you understand the full ingestion flow, let’s build it step by step. Here’s the Camel route you’ll be working with:

kaoto service x12 route

Notice that sql and store-pdf-s3 are grayed out — they’re disabled in the route. Camel will skip them when running. The idea is to start small: get the first steps working, verify the results, then enable the next ones as you progress.


EDI to XML transformation

With the active steps (platform-http and transform-x12), the route receives a policy application in EDI format and returns it as XML:

Hover over the Policy Application and Policy Document nodes in the diagram below to see what the EDI and XML formats look like.

flowchart LR
    PO["📄 Policy Application\n(EDI)"] -->|HTTP request| Camel((Camel)) -->|response| XML["📄 Policy Document\n(XML)"]

Before running the route, let’s configure the data mapping so the XML output includes Parasol Insurance as the Insurer.


Explore and modify the data mapping

The transform-x12 step uses a Kaoto data mapper to convert EDI fields into XML. Let’s open it to see how the mappings work, and configure the Insurer address with Parasol Insurance’s details.

Switch to the transform-x12 route:

  1. Click the Routes dropdown

  2. Select transform-x12


kaoto routes transform

kaoto-routes-transform

{x: 27, y: 22, rot: 220, size: 1}
{x: 21, y: 85, rot: 230, size: .9}

{x: 42, y: -15, size: 1.5}
{x: 38, y: 57, size: 1.5}


You should now see the transform-x12 route:

kaoto transform x12 route

kaoto-transform-x12-route

{x: 25.7, y: 37, size: 1.3} {x: 52.7, y: 26.5, size: 1.3} {x: 77.5, y: 37, size: 1.3}

Reading left to right, the route:

1 unmarshal — parses the raw EDI data into a structured format using the X12-850 schema

2  To do: Update  — contains the kaoto-datamapper step where the EDI-to-XML field mappings are defined

3 get policyid — (set variable step) obtains the policy number from the resulting XML for use downstream


Open and explore the data mapping

  1. Find the data mapping definition as follows:

    kaoto datamapper configure open

    kaoto-datamapper-configure-open

    {x: 32.4, y: 62, rot: 0, size: 1, color: "red"}

    {x: 32.4, y: 107, size: 1.2, color: "red"} {x: 78.5, y: 107, size: 1.2, color: "red"}


    1 Click the kaoto-datamapper step inside the  To do: Update  container

    2 Click the Configure button to open the data mapper


    You should see the mapping with the EDI source fields on the left (X12_850) connected to the XML target fields on the right (PolicyDocument):

    Overview of the data mapper UI.

    This is what the data mapper looks like — Source on the left (where data comes from) and Target on the right (where data is mapped to):

    kaoto datamapper overview

    kaoto datamapper mappings


  2. Explore the mappings

    On the right side (Target), find near the top the Insurer > Address section. Each address field is mapped using XPath expressions that extract values from the original EDI data.


  3. Configure the Insurer information

    Let’s redefine the mapped fields with Parasol’s hardcoded details. Replace the following fields in the Target with hardcoded values:

    1. Name — the insurer’s name

      "Parasol Insurance"

    2. Street — street address

      "One Parasol Plaza"

    3. City

      "Atlanta"

    4. State

      "GA"

    5. PostalCode

      "30313"

      String values must be wrapped in double quotes (e.g. "Atlanta"). Without quotes, the data mapper treats the value as an XPath expression instead of a literal string.

    Your data mapper should now show Parasol Insurance’s hardcoded values in the Insurer fields:

    kaoto datamapper personalized


    To return to the canvas, click the Design tab:

    kaoto design tab


  4. Run the route and test

    In the VS Code terminal inside Dev Spaces, run the route:

    camel run * --dev

    What does this command do?
    • camel run — runs a Camel integration using JBang

    • * — includes all source files in the current directory (routes, properties, supporting code)

    • --dev — enables dev mode: Camel watches for file changes and reloads the route automatically

    DevSpaces will detect that port 8080 is open and show a notification — click Open In New Tab to open the embedded Test Portal in your browser.

    devspaces port notification

    In the Test Portal:

    testshop order

    testshop-order

    {x: 82, y: 12, size: 1.5} {x: 35, y: 88, size: 1.5} {x: 68, y: 60, size: 1.5}

    1. Select a coverage — note the total amount

    2. Expand EDI X12 850 Preview to peek at the raw EDI message — no need to fully understand it, but you may spot the coverage name, quantity, and total amount in the data

    3. Click Submit Application — the portal sends the Policy Application to your Camel route

    Once processed, Camel returns the transformed XML and the Test Portal displays it. Notice the Insurer now shows Parasol Insurance’s hardcoded details — not the original EDI data:

    <Insurer>
        <Name>Parasol Insurance</Name>
        <Address>
            <Street>One Parasol Plaza</Street>
            <City>Atlanta</City>
            <State>GA</State>
            <PostalCode>30313</PostalCode>
        </Address>
        <TaxId>939988477</TaxId>
        <IBAN/>
    </Insurer>

    Now click Check Database — since the sql step is still disabled in the route, the policy data was never stored. You should see:

    Check Database
    No record found (Policy Document 19462522)

    This is expected — you’ll enable the database step next.


Enable the SQL step

With the transformation working, it’s time to enable the next step in the route — persisting the policy data to the database.

Ensure you are in the Design view:

kaoto design tab


  1. Switch back to the main flow

    Select ☰ service-x12 1/5 ▾ from the Routes dropdown.


  2. Enable the sql step

    1. Hover over the sql step — a toolbar appears above it

    2. Click the Enable step button (the tick icon)


    kaoto enable step

    kaoto-enable-step

    {x: 35, y: 15, rot: -130, size: 1}

    {x: 40, y: 68, size: 2.5} {x: 60, y: -18, size: 2.5}

    Since Camel is running in --dev mode, the route will reload automatically with the new step active.


  3. Place a new order

    Go back to the Test Portal and submit a new policy application. The route will now transform the EDI and insert the data into the database.


  4. Check the database

    This time, click Check Database — the policy data should now be stored:

    Check Database
    Record found (Policy Document 71960809)


Enable the S3 storage step

The last step in the route generates a PDF policy document from the XML and uploads it to S3 object storage.


  1. Enable the store-pdf-s3 step

    Same as before — hover over the store-pdf-s3 step and click the Enable step button (the tick icon). The route will reload automatically.


    With all steps enabled, the full ingestion flow is now active:

    kaoto service x12 all enabled
    What does store-pdf-s3 do?

    Select it from the Routes dropdown to see its sub-route — it applies an XSLT template to produce a PDF from the XML policy document, uploads it to S3 object storage, and returns a presigned link to the document.

    kaoto store pdf s3 route


  2. Place a new order

    Go back to the Test Portal and submit another policy application. This time, the full flow runs — transformation, database insert, PDF generation, and S3 upload. The Test Portal will display a confirmation with a link to the generated policy document:

    Policy Document Generated

    Your application has been processed and a policy document is ready.

    View Policy Document (PDF)
    invoice_66507812.pdf
    Check Database


    Click View Policy Document (PDF) to open it in your browser. The Insurer section should display Parasol Insurance’s details:

    Insurer:
    Parasol Insurance
    One Parasol Plaza
    Atlanta, GA 30313


When you’re done, press Ctrl+C in the terminal to stop Camel.


Does the Insurer section show Parasol Insurance?

The full ingestion flow is working — EDI transformation, database storage, and PDF generation are all connected. You’re ready to deploy.

Review the data mapper values and make sure Camel reloaded after saving. Try sending the request again.