|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Mapping Node conversion to <Type_n_dateTime> |
« View previous topic :: View next topic » |
Author |
Message
|
mzm.shan |
Posted: Mon Dec 28, 2015 4:38 am Post subject: Mapping Node conversion to <Type_n_dateTime> |
|
|
Apprentice
Joined: 25 Aug 2013 Posts: 39
|
Hi all,
I am using mapping node where source model is soap base and destination is ISO8583. soap gives string transmissiondate time as MMddHHmmss and destination transmissiondatetime in ISO8583 model is <Type_n_dateTime>.
it showed me warning at first:
"the string simple type input does not match the <Type_n_dateTime> simple type output.
use a convert transform to ensure proper conversion."
i saw some conversions but cant find the correct format "MMddHHmmss". |
|
Back to top |
|
 |
martinb |
Posted: Wed Dec 30, 2015 2:25 am Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
The built in type conversion in the Graphical Data Mapper will only provide you with conversion between certain standard XML schema data types.
Here you are needing to convert some "custom" format, from a string you have formatted as "MMddHHmmss" to another string with it's date time format according to ISO8583 model is <Type_n_dateTime>.
I am assuming you are using DFDL ISO8583 model?
https://github.com/DFDLSchemas/ISO8583/blob/master/Common/ISO8583Types.xsd
Then "Type_n_dateTime" is "yyMMddHHmmss".
Then the question is where will you obtain the year from?
Once you have answered that you could look to use a simple "Concat" transform if you happen to have a 2 digit year string in another field, or maybe you might need a Custom XPath transform to extract a year and concatenate it.
HTH |
|
Back to top |
|
 |
mzm.shan |
Posted: Wed Dec 30, 2015 2:42 am Post subject: |
|
|
Apprentice
Joined: 25 Aug 2013 Posts: 39
|
yes i am using DFDL ISO8583 model and the TransmissionDateTime field is MMddHHmmss. Soap source also not sending me year ex: 0323145522
and i need to map it to ISO DFDL. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Dec 30, 2015 8:31 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
If you wanted to demonstrate the problem to the source system with not giving you a year, you could always set it to 0 or 1.
martinb - shouldn't there be some kind of format ala ESQL CAST format pattern in Map node? _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
martinb |
Posted: Wed Dec 30, 2015 2:29 pm Post subject: |
|
|
Master
Joined: 09 Nov 2006 Posts: 210 Location: UK
|
The Mapping Node / Graphical Data Mapper supports XPath 2.0, which while offering a wide range of functions, does not include "format by pattern" type functions.
(Note, you might find XPath functions that do format by pattern, eg fn:format-dateTime(), but they are part of the XPath 3.0 spec)
So the options you have are:
- Use functions from the XPath 2.0 library, perhaps in mzm.shan's case just use (where "InputSoapDateTime" represents the input):
Code: |
fn:concat('15' $InputSoapDateTime) |
But that is soon to be no good so it would likely need more than a single function, so you can use an expression in a Custom XPath transform, eg:
Code: |
fn:concat( xs:string(fn:year-from-date(fn:current-date())) $InputSoapDateTime ) |
- If you prefer to format using Java, then you can call out to a static function from a Custom Java transform
- Or indeed ESQL can be called from Custom ESQL |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|