ballerinax/edifact.d03a.manufacturing Ballerina library

1.0.1

Overview

UN/EDIFACT D03A Manufacturing group EDI parser: reads and writes the 17 messages covering product service and project task planning, quality and safety/hazard data, utilities master data and time series, metered services consumption, repair calls, in-transit reports, and accounting entries and statements of account.

UN/EDIFACT is the United Nations standard for electronic data interchange, used to exchange business documents such as orders, invoices and despatch advices between trading partners.

Key Features

  • Typed records for all 17 messages in the manufacturing group, each in its own submodule, so a program only pulls in the records for the messages it handles.
  • Envelope-aware parsing and serialization: an interchange is read from UNB through UNZ, including the UNH/UNT message header and trailer.
  • Round-trips in both directions — EDI text to records, and records back to conformant EDI text with the UNT segment count recomputed.
  • Generated from the UN/EDIFACT D03A directory with the Ballerina EDI tool, so the records follow the published specification.

Quickstart

To use the edifact.d03a.manufacturing package in your Ballerina application, modify the .bal file as follows:

Step 1: Import the module

Import the package and the submodules for the messages you handle.

Copy
import ballerina/io;
import ballerinax/edifact.d03a.manufacturing;
import ballerinax/edifact.d03a.manufacturing.mCNTCND;

Step 2: Read an EDI message

Convert an EDIFACT interchange into a Ballerina record.

Copy
public function main() returns error? {
    string ediText = check io:fileReadString("cntcnd.edi");
    mCNTCND:EDI_CNTCND_CNTCND message =
        check manufacturing:fromEdiString(ediText, manufacturing:EDI_CNTCND).ensureType();
    io:println(message);
}

manufacturing:getEDINames() returns every message name this package supports. interchangeFromEdiString gives access to the full UNB/UNZ interchange, and headersFromEdiString reads just the headers.

Step 3: Write an EDI message

Convert a Ballerina record back into an EDIFACT interchange.

Copy
string ediText = check manufacturing:toEdiString(message, manufacturing:EDI_CNTCND);

Use interchangeToEdiString to write the full interchange rather than the message body alone.

Step 4: Run the Ballerina application

Copy
bal run

Supported messages

MessageDescriptionModule
CNTCNDContractual conditionsedifact.d03a.manufacturing.mCNTCND
DMRDEFData maintenance request definitionedifact.d03a.manufacturing.mDMRDEF
ENTRECAccounting entriesedifact.d03a.manufacturing.mENTREC
IMPDEFEDI implementation guide definitionedifact.d03a.manufacturing.mIMPDEF
INFENTEnterprise accounting informationedifact.d03a.manufacturing.mINFENT
ITRRPTIn transit report detailedifact.d03a.manufacturing.mITRRPT
MSCONSMetered services consumption reportedifact.d03a.manufacturing.mMSCONS
PROSRVProduct serviceedifact.d03a.manufacturing.mPROSRV
PROTAPProject tasks planningedifact.d03a.manufacturing.mPROTAP
QALITYQuality dataedifact.d03a.manufacturing.mQALITY
RELISTReinsured objects listedifact.d03a.manufacturing.mRELIST
RPCALLRepair calledifact.d03a.manufacturing.mRPCALL
SAFHAZSafety and hazard dataedifact.d03a.manufacturing.mSAFHAZ
STATACStatement of accountedifact.d03a.manufacturing.mSTATAC
UTILMDUtilities master dataedifact.d03a.manufacturing.mUTILMD
UTILTSUtilities time seriesedifact.d03a.manufacturing.mUTILTS
WASDISWaste disposal informationedifact.d03a.manufacturing.mWASDIS

Import

import ballerinax/edifact.d03a.manufacturing;Copy

Other versions

Metadata

Released date: 4 days ago

Version: 1.0.1

License: Apache-2.0


Compatibility

Platform: any

Ballerina version: 2201.12.0

GraalVM compatible: Yes


Pull count

Total: 24

Current verison: 1


Weekly downloads


Source repository


Keywords

utilities

quality

EDI

EDIFACT

D03A

Vendor/Other

Area/ERP & Business Operations

Type/Library

Name/EDIFACT D03A Manufacturing


Contributors