ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » IIB XML to fixed length Text DFDL is not padding characters?

Post new topic  Reply to topic Goto page Previous  1, 2
 IIB XML to fixed length Text DFDL is not padding characters? « View previous topic :: View next topic » 
Author Message
junaid
PostPosted: Tue Dec 04, 2018 5:40 am    Post subject: IIB DFDL Validation not performed using mapping node Reply with quote

Acolyte

Joined: 29 Nov 2018
Posts: 58

Understood,
lets say DFDL field1 & field2 has max: length=5
what if input is of length 10 in a message flow and we want to pass 5 out of 10 to first and 5 to second according to dfdl ???

In my case: i have mapping node having source of only 1 field has length 10 and target with above DFDL having two fields of length 5 and 5. what mapping does it transform and put length of 10 to field1 and also to field 2. i want field 1 break to 5 and field 2 as well to 5 ????
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Dec 04, 2018 6:07 am    Post subject: Re: IIB DFDL Validation not performed using mapping node Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20696
Location: LI,NY

junaid wrote:
Understood,
lets say DFDL field1 & field2 has max: length=5
what if input is of length 10 in a message flow and we want to pass 5 out of 10 to first and 5 to second according to dfdl ???

In my case: i have mapping node having source of only 1 field has length 10 and target with above DFDL having two fields of length 5 and 5. what mapping does it transform and put length of 10 to field1 and also to field 2. i want field 1 break to 5 and field 2 as well to 5 ????

I don't quite understand you. Do you mean you mapped field 1 length 10 to DFDL group 1 with field a length 5 and field b length 5?

You are talking here about a split of the input field. How are you bringing that split about?

Or do you mean that you move input field 1 (pic x 10) to both output field a (pic x 5)and output field b (pic x 5) and you'd like both to truncate at 5 ?
I believe there is a DFDL policy that allows you to truncate...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
junaid
PostPosted: Tue Dec 04, 2018 6:20 am    Post subject: Reply with quote

Acolyte

Joined: 29 Nov 2018
Posts: 58

from your reply, i want and doing:
Quote:

do you mean that you move input field 1 (pic x 10) to both output field a (pic x 5)and output field b (pic x 5) and you'd like both to truncate at 5 ?
.


Code:


Source DFDL
--------------

   <xsd:element dfdl:lengthKind="implicit" dfdl:lengthUnits="characters" dfdl:textPadKind="padChar" dfdl:textTrimKind="none" dfdl:truncateSpecifiedLengthString="yes" ibmDfdlExtn:sampleValue="body_valu1" name="body_elem1">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:minLength value="10"/>
                    <xsd:maxLength value="10"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>



Target DFDL:
---------------
DFDL property for field1:

<xsd:element dfdl:lengthKind="implicit" dfdl:lengthUnits="characters" dfdl:textPadKind="padChar" dfdl:textTrimKind="none" dfdl:truncateSpecifiedLengthString="yes" ibmDfdlExtn:sampleValue="" name="body_elem1">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:maxLength value="5"/>
                    <xsd:minLength value="5"/>
                </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>

and field2:

<xsd:element dfdl:lengthKind="implicit" dfdl:lengthUnits="characters" dfdl:textPadKind="padChar" dfdl:textTrimKind="none" dfdl:truncateSpecifiedLengthString="yes" ibmDfdlExtn:sampleValue="body_valu2" name="body_elem2">
                <xsd:simpleType>
                  <xsd:restriction base="xsd:string">
                    <xsd:minLength value="5"/>
                    <xsd:maxLength value="5"/>
                  </xsd:restriction>
                </xsd:simpleType>
              </xsd:element>

I tried truncate but nothing happened ?
Back to top
View user's profile Send private message
timber
PostPosted: Tue Dec 04, 2018 7:12 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

Quote:
In my case: i have mapping node having source of only 1 field has length 10 and target with above DFDL having two fields of length 5 and 5. what mapping does it transform and put length of 10 to field1 and also to field 2. i want field 1 break to 5 and field 2 as well to 5 ????
I may be wrong, but I think you are still learning how IIB works. Specifically, I think you are still struggling with the difference between mapping (what the Mapping node does) and parsing/writing (what the DFDL parser does).

The mapping node takes an input message tree and creates an output message tree. You can specify a DFDL scheme for the output side of the Mapping node but the Mapping node will only look at its XML Schema structure (i.e. the hierarchy of element definitions). The Mapping node will completely ignore all of the DFDL annotations in the DFDL schema. This is good - the Mapping node should not be concerned with the (eventual) physical format of the data.

I think the next step is for you to describe (in detail)
- what your inputs are
- what behaviour you want from your message flow
...and we will gladly assist with the IIB concepts.
Back to top
View user's profile Send private message
junaid
PostPosted: Tue Dec 04, 2018 9:12 pm    Post subject: IIB Reply with quote

Acolyte

Joined: 29 Nov 2018
Posts: 58

Thanx,
yaah, i am a beginner to IIB,

Scenario is:

1) we have a WSDL of say 1 field.
2) and 2 DFDL XSD's ( first DFDL has only 1 field of length 239 and second DFDL has 2 fields of lengths 100 and 139)
3)and one compute node for java callout.

what i want to do, i pass my input to java compute node and get response from java compute OUT in a field named "body_elem1" which is ,
Code:

<message>
<DFDL>
<TFRes_DFDL>
<body>
<body_elem1>PHXGDCI200000210201811271458301800000017            0002000001100                 01820181127145830181127111906                                                                                                                        11190610</body_elem1>
</body>
</TFRes_DFDL>
</DFDL>
</message>


after getting response from javacallout, i use mapping node whose IN is above javacallout OUT.

Inside mapping node, i use above described two DFDLs,
1)at source side of mapping , i have DFDL having 1 field for getting response of callout OUT which works fine.
Code:

<message>
<DFDL>
<TFRes_DFDL>
<body>
<body_elem1>PHXGDCI200000210201811271458301800000017            0002000001100                 01820181127145830181127111906                                                                                                                        11190610</body_elem1>
</body>
</TFRes_DFDL>
</DFDL>
</message>


Now, source of mapping having field "body_elem1" has length of 239.

2) and source is mapped to target DFDL which has two fields.
ie.

Code:

<DFDL>
<testRes>
<body>
<body_elem1>PHXGDCI200000210201811271458301800000017            0002000001100                 01820181127145830181127111906                                                                                                                        11190610</body_elem1>
<body_elem2>PHXGDCI200000210201811271458301800000017            0002000001100                 01820181127145830181127111906                                                                                                                        11190610</body_elem2>
</body>
</testRes>
</DFDL>


all works fine till now except,

I want after mapping <testRes > fields should be:
<body_elem1> should have length of 100 from 239.
<body_elem2> should have length of 139 from 239-100(consumed by body_elem1).
i.e
Code:

<DFDL>
<testRes>
<body>
<body_elem1>PHXGDCI200000210201811271458301800000017            0002000001100                 018201811271458301</body_elem1>
<body_elem2>81127111906                                                                                                                        11190610</body_elem2>
</body>
</testRes>
</DFDL>


why DFDL properties(max:length of 100 for field1 and 139 for field2) are not working inside mapping and if mapping only mapp fields that what is solution for my case ???
Back to top
View user's profile Send private message
timber
PostPosted: Wed Dec 05, 2018 3:05 am    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1280

You are using the wrong node. The Mapping node is not designed to do what you were expecting it to do.

I recommend:
- Propagate the result of the Java call as a BLOB
- Insert a ResetContentDescriptor node and change the Domain to 'DFDL'
This will cause the bitstream received by your Java call to be parsed into a new message tree using the DFDL parser.

You could probably solve the problem with the TCPIP nodes (the prefixed length) using DFDL as well, but I won't go into details on that unless you're interested in giving it a try.
Back to top
View user's profile Send private message
junaid
PostPosted: Wed Dec 05, 2018 9:03 pm    Post subject: IIB XML to fixed length Text DFDL is not padding characters? Reply with quote

Acolyte

Joined: 29 Nov 2018
Posts: 58

Thanks, tried Reset Content Descriptor , following is the flow

Quote:
Input>>> Mapping(XML>DFDL) >>> JavaCompute>>> Reset Content Descriptor >> Mapping(DFDL>XML)>>>Output


selected message & message domain to DFDL in Reset Content Descriptor.

and in java compute created blob as following.
Code:
    rootelem.getLastChild().delete();
   
          String parserName = MbBLOB.PARSER_NAME;
          String messageType = "";
          String messageSet = "";
          String messageFormat = "";
          int encoding = 0;
          int ccsid = 0;
          int options = 0;
          rootelem.createElementAsLastChildFromBitstream(str2.getBytes(),
            parserName, messageType, messageSet, messageFormat, encoding, ccsid,
            options);

Output is as following.

Code:
<message>
<Properties>
</Properties>
<HTTPInputHeader>
</HTTPInputHeader>
<BLOB>
<BLOB>20202020202020202020494268414d68442020202020202020202020</BLOB>
</BLOB>
</message>


In output of Reset Content Descriptor node it remains same
Mapping code is as following in which body_elem1 is mapped to RESCODE. but no value is coming in last.

Code:

<?xml version="1.0" encoding="UTF-8"?><mappingRoot xmlns="http://www.ibm.com/2008/ccl/Mapping" domainID="com.ibm.msl.mapping.xml" domainIDExtension="mb" mainMap="true" targetNamespace="gen" version="8.0.5.0" xmlns:map="gen">
    <input path="/aaaa.xsd"/>
    <output path="/TFTest_InlineSchema1.xsd"/>
    <namespaces>
        <namespace kind="supplement" prefix="out" uri="http://TFTest"/>
        <namespace kind="extension" prefix="fn" uri="http://www.w3.org/2005/xpath-functions"/>
    </namespaces>
    <generation engine="xquery"/>
    <mappingDeclaration name="TF_Request_Response_Mapping1">
        <input path="mb:msg(aaaa,assembly,DFDL,Properties)" var="ComIbmMessageAssembly_aaaa"/>
        <output namespace="http://TFTest" path="mb:msg(TFResponse,assembly,XMLNSC,Properties)" var="ComIbmMessageAssembly_TFResponse"/>
        <move>
            <input path="$ComIbmMessageAssembly_aaaa/Properties"/>
            <output path="$ComIbmMessageAssembly_TFResponse/Properties"/>
        </move>
        <move>
            <input path="$ComIbmMessageAssembly_aaaa/aaaa/body/body_elem1"/>
            <output path="$ComIbmMessageAssembly_TFResponse/TFResponse/RESCODE"/>
        </move>
    </mappingDeclaration>
</mappingRoot>
Back to top
View user's profile Send private message
junaid
PostPosted: Thu Dec 06, 2018 8:09 pm    Post subject: IIB XML to fixed length Text DFDL is not padding characters? Reply with quote

Acolyte

Joined: 29 Nov 2018
Posts: 58

Thanks Done by marking checks on (Reset Message domain) & Reset Message, in reset content descriptor
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » IIB XML to fixed length Text DFDL is not padding characters?
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.