Author |
Message
|
Andrey |
Posted: Wed Sep 05, 2001 4:27 am Post subject: |
|
|
Apprentice
Joined: 02 Sep 2001 Posts: 37 Location: Belarus, Minsk
|
Hi,
I'm new in NEON Formatter and Rules tools. But I need to do some tasks.
Could anybody describe step-by-step flow to create and test formatter to transform a message with fixed length (for example, 'Andy1974' - length is 8 chars) to XML doc with the following structure?:
Andy
1974
And if possible vise vesa too.
Thanks to all. |
|
Back to top |
|
 |
jhalstead |
Posted: Wed Sep 05, 2001 5:04 am Post subject: |
|
|
 Master
Joined: 16 Aug 2001 Posts: 258 Location: London
|
Andrey.
Not sure if all the XML made it through onto the post.
First stage.
Create 2 input fields for input message.
Let say both these fields are to be fixed length (10 characters).
Create an input control:
Control type - Data only,
Data type - string,
Termination - exact length,
Length - 10.
Create a flat input format, add the 2 field components to the format (right click menu).
Select the fields within the format and assign the input control you created to both fields.
This should look after your input parse.
You can test this with the Visual Tester.
On the test format tab select:
Data Source - Screen radio button.
Enter your format name as the message type.
enter your input message in the message field (remember we're defining the fields as ten characters):
'Andy 1974 '
Click the test button.
Let me know how you get on with the inbound component if all is well we'll go onto the outbound re-format.
Jamie |
|
Back to top |
|
 |
Andrey |
Posted: Wed Sep 05, 2001 6:57 am Post subject: |
|
|
Apprentice
Joined: 02 Sep 2001 Posts: 37 Location: Belarus, Minsk
|
Jamie,
It's great!!!
It works fine!!!
Thank you very very much. It's very important for me!
Could you help me more. I mean output format.
Thanks in advance, Andrey |
|
Back to top |
|
 |
jhalstead |
Posted: Wed Sep 05, 2001 8:07 am Post subject: |
|
|
 Master
Joined: 16 Aug 2001 Posts: 258 Location: London
|
Okay creating the output format.
Create Literals
"<Root>" Hex:3c526f6f743e0d0a
"</Root>" Hex:3c2f526f6f743e0d0a
"<Nick>" Hex:3c4e69636b3e
"</Nick>" Hex:3c2f4e69636b3e
"<Year>" Hex:3c596561723e
"</Year>" Hex:3c2f596561723e
"Space" Hex:20
"Return" Hex:0d0a
Create fields
XMLStart
XMLEnd
XMLName
XMLYear
Create output operations
Trim operations
TrimSpace - Trim space literal from both sides)
Prefix/Suffix operations (assign the literals to these as the names suggest)
Prefix<Nick>
Prefix<Year>
Suffix</Nick>
Suffix</Year>
SuffixReturn
Create output collections
Nick - which has the following output operations:
LEFT_JUSTIFY
TrimSpaces
Prefix<Nick>
Suffix</Nick>
SuffixReturn
Year - which has the following output operations:
LEFT_JUSTIFY
TrimSpaces
Prefix<Year>
Suffix</Year>
SuffixReturn
Create output controls
Start:
Output control type - Literal
Field Value - <Root>
Nick:
Output contorl type - Data Field
Output Collection - Nick
Data type - String
Year:
Output contorl type - Data Field
Output Collection - Year
Data type - String
End:
Output control type - Literal
Field Value - </Root>
Creat output format
Create a flat output format, add the 4 field components to the format (right click menu).
Select the fields within the format and assign the input control you created to them.
Now you should be able to use visual tester to do the reformat.
On the test reformat tab select:
Data Source - Screen radio button.
Enter your input format name as the message type.
Enter yout output format name as the output message type.
enter your input message in the message field as before....
Hope this work for you
Jamie
|
|
Back to top |
|
 |
bh |
Posted: Wed Sep 05, 2001 8:08 am Post subject: |
|
|
Acolyte
Joined: 25 Jun 2001 Posts: 61
|
Are you using Neon formater in MQSI V2 (and if it's the case, version V202) ?
Because if it's the case you can transform your input data (defined in the Neon formater) in XML output data very easely. If it's your purpose tell me, I'll give you the total answer. |
|
Back to top |
|
 |
Andrey |
Posted: Wed Sep 05, 2001 11:16 pm Post subject: |
|
|
Apprentice
Joined: 02 Sep 2001 Posts: 37 Location: Belarus, Minsk
|
Thank you, Jamie
All works fine, just space triming does not work
Jamie, could you help me more? Just can you explain me how I can use my new formatter in MQSI? I need to convert incoming MQ message (string) to XML. Can you help me?
BH, yes, I'm using MQSI V2.0.2 and I really need to convert string to XML and vise vesa. If you know a way to do it, please tell me how.
Thanks to all
|
|
Back to top |
|
 |
Andrey |
Posted: Thu Sep 06, 2001 3:14 am Post subject: |
|
|
Apprentice
Joined: 02 Sep 2001 Posts: 37 Location: Belarus, Minsk
|
Quote: |
On 2001-09-05 09:08, bh wrote:
Are you using Neon formater in MQSI V2 (and if it's the case, version V202) ?
Because if it's the case you can transform your input data (defined in the Neon formater) in XML output data very easely. If it's your purpose tell me, I'll give you the total answer.
|
Yes, i'm using MQSI v2.0.2 and i need to convert input data (string) to XML and vise vesa. If you know a way how to do it, tell me please. |
|
Back to top |
|
 |
bh |
Posted: Thu Sep 06, 2001 6:00 am Post subject: |
|
|
Acolyte
Joined: 25 Jun 2001 Posts: 61
|
Well let's see the different ways:
For instance, the input flow is :
Smith;John;
And you want to transform it into an output flow like:
SmithJohn
To do that, just declare the format (SampleFormat for instance) in the neon formater and apply a 'NeonMap' node (available since the V202) in the message flow, just after the MQInputNode (with formats properties for Neon). To set this 'new' node up, you'll just have to set the target format as 'SampleFormat' (as defined in Neon) and set the OutputDomain with the value 'XML'.
With this way MQSI will transform very quickly and easely the 'flat string' neon format into a XML format using the element names for the names of the XML tags (be carefull).
For the other way (XML to 'string'), I think the use of MRM could be an easy way (if you can parse your 'string format' with the actual MRM. If it's not the case, still use the Neon parser.
By the way, with the V202, you can view Neon format in the MRM (just a view not modify) and so manipulate data from MRM to Neon or Neon to MRM by 'drag and drop'.
|
|
Back to top |
|
 |
bh |
Posted: Thu Sep 06, 2001 6:02 am Post subject: |
|
|
Acolyte
Joined: 25 Jun 2001 Posts: 61
|
Of course the output flow is
<name>Smith</name><firstname>John</firstname>
I forgot to diseable HTML. |
|
Back to top |
|
 |
Andrey |
Posted: Thu Sep 06, 2001 7:54 am Post subject: |
|
|
Apprentice
Joined: 02 Sep 2001 Posts: 37 Location: Belarus, Minsk
|
Can somebody help me again? I would like to make some test for my Formatter. I made the following shema:
MQInput node (parser BLOB)
Compute node (where i set input message format SET OutputRoot.Properties.MessageType = 'Format1'
NEONTransform node (where i set target format to my out_format and output domain to XML)
MQOutput node to put message to queue.
Other words, can i use BLOB data as input data for Formatter or not?
I expect that BLOB data will pass to Formatter for transformation, but Formatter throws error (1001) instead it.
What is wrong?
[ This Message was edited by: Andrey on 2001-09-06 09:16 ] |
|
Back to top |
|
 |
bh |
Posted: Thu Sep 06, 2001 8:23 am Post subject: |
|
|
Acolyte
Joined: 25 Jun 2001 Posts: 61
|
You had rather to set up your MQInput node with the following parameters:
Message Domain: NEON
MessageType : The Neon InputFormat name.
Or if you want to use a generic MQInputNode with the BLOB option, you should use a ResetContentDescriptor node to allow MQSI to understand wich parser to use with wich Input description... |
|
Back to top |
|
 |
Andrey |
Posted: Thu Sep 06, 2001 8:42 am Post subject: |
|
|
Apprentice
Joined: 02 Sep 2001 Posts: 37 Location: Belarus, Minsk
|
Quote: |
On 2001-09-06 09:23, bh wrote:
You had rather to set up your MQInput node with the following parameters:
Message Domain: NEON
MessageType : The Neon InputFormat name.
Or if you want to use a generic MQInputNode with the BLOB option, you should use a ResetContentDescriptor node to allow MQSI to understand wich parser to use with wich Input description...
|
Yes, the second case is more preffered for me, but there is an exception 'Parse or Reformat called without supplying an input message'. After ResetContentDescriptor is called, BLOB tag disappears and empty NEON tag appears. It seems that data is lost. Any suggestions?
Thanks in advance. |
|
Back to top |
|
 |
bh |
Posted: Thu Sep 06, 2001 11:50 pm Post subject: |
|
|
Acolyte
Joined: 25 Jun 2001 Posts: 61
|
Your message looks like the Neon Formater can't achieve the parsing. What I would suggest you is to verify first you can parse your data correctly (with the visual tester from Neon). If it works, the ResetContentDescriptor (RCD) should be OK (with the right properties of course. Try by the same time to use Trace nodes (before and after) RCD node with the ${Body} so you would see what'is exactly parsed. |
|
Back to top |
|
 |
bh |
Posted: Fri Sep 07, 2001 1:14 am Post subject: |
|
|
Acolyte
Joined: 25 Jun 2001 Posts: 61
|
Just to continue to give you some samples.
Here is an example of a message flow receiving XML data who has to be parsed by the Neon parser.
In the input, I received:
<DEMO_IN_VARIABLE_CLIENT>
<In_Nom_Client>DUPONT</In_Nom_Client>
<In_Prenom_Client>Jean-Pierre</In_Prenom_Client>
<In_Adresse_Client>25, rue du Cherche Midi</In_Adresse_Client>
<In_Code_Postal_Client>75005</In_Code_Postal_Client>
<In_Ville_Client>PARIS</In_Ville_Client>
</DEMO_IN_VARIABLE_CLIENT>
And I have to generate
25, rue du Cherche Midi/75005/PARIS/DUPONT/Jean-Pierre
What I have define is:
In NeonFormater:
an input format called DEMO_IN_VARIABLE_CLIENT
and an output format called
DEMO_OUT_VARIABLE_CLIENT
My message flow is composed of
A MQInput Node (Message Domain: XML)
A Compute node (with just 'copy Message Header) and the following eSQL code:
SET OutputRoot.Properties.MessageType ='NEONMSG';
SET OutputRoot.Properties.MessageType ='DEMO_OUT_VARIABLE_CLIENT';
Set "OutputRoot"."NEONMSG"."DEMO_OUT_VARIABLE_CLIENT"[] = "InputRoot"."XML"[];
And I've the result I wanted... |
|
Back to top |
|
 |
Andrey |
Posted: Fri Sep 07, 2001 4:56 am Post subject: |
|
|
Apprentice
Joined: 02 Sep 2001 Posts: 37 Location: Belarus, Minsk
|
I don't know what is wrong
I test message formatter in Visual tester and it works fine. But in MQSI result is always the same as before.
My Formatter takes as input format (type is Format1) string with fixed length 10 and transform it into XML (type is Format2) with a root and two another tags. And as i said it works fine in Visual tester.
My flow consist of:
MQInput with message domain BLOB.
Compute node (as you suggested) with copy headers option and ESQL:
SET OutputRoot.Properties.MessageDomain ='NEONMSG';
SET OutputRoot.Properties.MessageType ='Format1';
SET OutputRoot."NEONMSG"."Format1" = "InputRoot"."BLOB"."BLOB";
NEONTransform node with target format Format2, OutputDomain XML.
And it does NOT work!!! WHY???
In event log appears the following record:
( broker.default ) The NEON Transform engine failed to transform a message with the following details:
Input message type : Format1
Output message type : Format2
Map Name :
Map Version :
Error # : 1001
Error message : Mandatory output field XMLName has no data due to either no associated input field OR using an access mode of Not Applicable with an input field OR using no data producing Output Operation (math expression, user exit or default value)
Please, if you can reply as soon as possible. I will be looking uninterruptedly.
Tahnks. |
|
Back to top |
|
 |
|