Claus Ibsen created CAMEL-23690:
-----------------------------------

             Summary: Add camel-ubl data format for UBL 2.1 (Universal Business 
Language) document marshalling
                 Key: CAMEL-23690
                 URL: https://issues.apache.org/jira/browse/CAMEL-23690
             Project: Camel
          Issue Type: New Feature
          Components: camel-core
            Reporter: Claus Ibsen


Add a new camel-ubl data format for marshalling and unmarshalling UBL 2.1 
(Universal Business Language) documents.

UBL 2.1 is an OASIS standard defining XML business document types (invoices, 
credit notes, orders, despatch advice, etc.) and is the document format used by 
the Peppol e-invoicing network. E-invoicing mandates are expanding rapidly 
across the EU (ViDA directive), UK (expected 2029), Singapore, and other 
countries, making UBL processing increasingly important for enterprise 
integration.

The data format should support:
- Marshal: convert UBL Java objects to XML
- Unmarshal: parse UBL XML into Java objects
- Auto-detection of UBL document type from XML root element or Java class name
- All 65 UBL 2.1 document types (Invoice, CreditNote, Order, DespatchAdvice, 
etc.)
- Options for formatted output, schema validation, charset

Implementation should use the ph-ubl21 library (https://github.com/phax/ph-ubl) 
by Philip Helger as the underlying JAXB binding layer. This library is Apache 
2.0 licensed, mature, and well-maintained.

A data format is the correct Camel pattern for this (similar to jacksonXml, 
jaxb, etc.) rather than a component endpoint.

Usage example:
{code}
from("file:invoices")
  .unmarshal().custom("ubl")
  .process(exchange -> {
      InvoiceType invoice = exchange.getIn().getBody(InvoiceType.class);
      // process invoice
  });
{code}

Reference: https://github.com/dscope-io/dscope-camel-ubl (third-party 
implementation as a component, demonstrates the concept but a data format is 
the idiomatic Camel approach).
Reference: https://peppol.org/ (Peppol e-invoicing network using UBL 2.1)



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to