Hi Steve,
Thanks for the reply. I am using IBM ISO 8583 scheme only.I have tried setting the missing fields. But no luck. Please find my code
CREATE COMPUTE MODULE isomessageflow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
--SET OutputRoot.Properties.MessageType = '{ISO8583}:ISO8583_1987';
--SET OutputRoot.Properties.MessageSet = '{ISO8583}';
SET OutputRoot.Properties.MessageType = '{}:ISO8583_1987';
SET OutputRoot.DFDL.ISO8583_1987.MTI_Version = 1;
SET OutputRoot.DFDL.ISO8583_1987.MTI_MessageClass = 1;
SET OutputRoot.DFDL.ISO8583_1987.MTI_MessageFunction = 1;
SET OutputRoot.DFDL.ISO8583_1987.MTI_MessageOrigin = 1;
SET OutputRoot.DFDL.ISO8583_1987.PrimaryBitmap.Bit002 = 1;
SET OutputRoot.DFDL.ISO8583_1987.PrimaryAccountNumber_002 = '443';
CREATE LASTCHILD OF OutputRoot DOMAIN('BLOB');
SET OutputRoot.BLOB.BLOB = ASBITSTREAM(OutputRoot.DFDL);
--DELETE FIELD OutputRoot.DFDL;
RETURN TRUE;
END;
END MODULE;
------------------------------
SELVAKUMAR ANANTHARAJ
------------------------------
Original Message:
Sent: Tue September 07, 2021 04:19 AM
From: Steve Hanson
Subject: DFDL To ISO Conversion
Assuming you are using the example ISO8583 schemas from IBM, the ISO8583 1987 model does not have a namespace. Try:
SET OutputRoot.Properties.MessageType = '{}:ISO8583_1987';
Also, the DFDL message you are creating is not correct, as you are:
a) not creating the MTI_ fields
b) not creating the bitmap(s) and setting the bits for the fields that exist
c) the field names are wrong (eg, 'PrimaryAccountNumber' should be 'PrimaryAccountNumber_002'.)
If you are not using the ISO8583 schemas from IBM, you should use them - they are supplied as a Tutorial in IIB/ACE.
------------------------------
Steve Hanson
DFDL Architect
IBM UK
Winchester
Original Message:
Sent: Tue September 07, 2021 02:50 AM
From: SELVAKUMAR ANANTHARAJ
Subject: DFDL To ISO Conversion
Hi Matthew & Pierre,
Tried with the solution you have mentioned. But no luck. Still getting same error
Please find the code and error for your reference
CREATE COMPUTE MODULE isomessageflow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET OutputRoot.Properties.MessageType = '{ISO8583}:ISO8583_1987';
SET OutputRoot.DFDL.ISO8583_1987.PrimaryAccountNumber = '443';
SET OutputRoot.DFDL.ISO8583_1987.AmountTransaction = '43';
CREATE LASTCHILD OF OutputRoot DOMAIN('BLOB');
SET OutputRoot.BLOB.BLOB = ASBITSTREAM(OutputRoot.DFDL);
--DELETE FIELD OutputRoot.DFDL;
RETURN TRUE;
END;
END MODULE;
Thanks for your support!!
------------------------------
SELVAKUMAR ANANTHARAJ
Original Message:
Sent: Mon September 06, 2021 02:11 AM
From: Pierre Richelle
Subject: DFDL To ISO Conversion
Hello SELVAKUMAR,
<Sorry the previous post didn't shown up when replying. Matthew already answered...>
When Matthew says that it it serialised on the output, he means when it is sent out using HTTP, MQ, or other nodes.
If you want to force the serialisation in the flow you need to use either a reset content descriptor node with message domain set to BLOB or use the ESQL function as Matthew mentioned (ASBITSTREAM):
SET OutputRoot.BLOB.BLOB = ASBITSTREAM(OutputRoot.DFDL.YourMessage OPTIONS RootBitStream);
------------------------------
Pierre Richelle
IBM Hybrid Cloud Integration Specialists
IBM
+32474681892
Original Message:
Sent: Fri September 03, 2021 12:19 AM
From: SELVAKUMAR ANANTHARAJ
Subject: DFDL To ISO Conversion
Hi Matthew,
Thanks for the reply!!
Below is my code
CREATE COMPUTE MODULE JSONmesssageflow_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
SET OutputRoot.DFDL.ISO8583_1987.PrimaryAccountNumber = InputRoot.JSON.Data.PrimaryAccountNumber_002;
SET OutputRoot.DFDL.ISO8583_1987.AmountTransaction = InputRoot.JSON.Data.AmountTransaction_004;
SET OutputRoot.DFDL.ISO8583_1987.AmountSettlement = InputRoot.JSON.Data.AmountSettlement_005;
RETURN TRUE;
END;
END MODULE;
I am expecting the ISO Message from this code to next node. But the output is still a tree structure. I am not sure why its not serialized when going to the next node.
------------------------------
SELVAKUMAR ANANTHARAJ
Original Message:
Sent: Thu September 02, 2021 05:43 PM
From: MATTHEW SEGALL
Subject: DFDL To ISO Conversion
We do not have any doc showing how to perform this conversion. Your steps look correct. I'm guessing the the DFDL values you are setting are incorrectly placed in the tree and thus ignored. For instance, if there is an array but you do not include "Item" in the path, DFDL will not recognize the element as being part of the array.
Without your sample data and ESQL code, it is hard to make a guess.
Serialization occurs on output, or you can use the ASBITSTREAM method within the flow to serialize on demand.
If you need additional assistance, please open a case and provide your project with ESQL code and your sample message.
------------------------------
MATTHEW SEGALL
Original Message:
Sent: Thu September 02, 2021 02:04 PM
From: SELVAKUMAR ANANTHARAJ
Subject: DFDL To ISO Conversion
Hi Team,
In my project, We are getting JSON from client and our requirement is to convert that JSON into ISO and send that ISO Message to TCP/IP Node.
We are using DFDL for converting JSON to ISO.
We have created the DFDL model and imported that as library in my project.
In my compute Node, I am setting values for few fields in DFDL.
But that DFDL value is not serialized into ISO while moving out from my Compute Node.
Is there any document or sample code available for converting the JSON to ISO and how to serialize the output of DFDL?
------------------------------
SELVAKUMAR ANANTHARAJ
------------------------------