Author |
Message
|
satya22777 |
Posted: Fri Sep 12, 2008 3:25 am Post subject: EmailOut Node in WMBv6.1 |
|
|
Apprentice
Joined: 03 Apr 2006 Posts: 31
|
Hello Every One,
My Eniveronment is WMBv6.1 in Win2000 professional.
I have Small problem with Emailout node.i.e I used to send the errordetails to the customer in my error handeling flow. I made it easily but i could'nt satisfied. I am getting the body of email is
<Data>SENDERID =2131 RECIEVERID=abcdef MAPNAME =ABCMAP ERRORLOG =LogDetails</Data>
My requirement is:
SENDERID =2131
RECIEVERID =abcdef
MAPNAME = ABCMAP
ERRORLOG =LogDetails
My Code is :
SET OutputRoot.EmailOutputHeader.Subject = 'ERRORLOG DETAILS';
SET OutputRoot.EmailOutputHeader.To = 'xyz@abc.com';
SET OutputRoot.EmailOutputHeader.From = 'TheRisingSun@ibm.in' ;
SET OutputLocalEnvironment.Destination.Email.BodyContentType = 'text/plain';
DECLARE SenderId CHARACTER InputRoot.XMLNSC.Error.SENDERID;
DECLARE RecieverId CHARACTER InputRoot.XMLNSC.Error.RECIEVERID;
DECLARE MapName CHARACTER InputRoot.XMLNSC.Error.MAPNAME;
DECLARE ErrorLog CHARACTER InputRoot.XMLNSC.Error.ERRORLOG;
SET OutputRoot.XMLNSC.Data ='SENDERID ='|| SenderId ||' '||
'RECIEVERID='|| RecieverId ||' '||
'MAPNAME ='|| MapName ||' '||
'ERRORLOG ='|| ErrorLog;
Please any body help me on this.. |
|
Back to top |
|
 |
MrSmith |
Posted: Fri Sep 12, 2008 3:51 am Post subject: |
|
|
 Master
Joined: 20 Mar 2008 Posts: 215
|
Your code to me seems to be doing exactly what you have asked it to do which is create a tag DATA and concatonate all thos values together! If you wanted to format it like your example above then you can either palce an end of line character at the point of each concatanation but that will depend on the platform it si going to be sent to as obviously *nix and Windows and others etc etc have different EOL characters but that would give you
SET OutputRoot.XMLNSC.Data =' \n || SENDERID ='|| SenderId ||'\n '||
'RECIEVERID='|| RecieverId ||'\n'||
'MAPNAME ='|| MapName ||'\n'||
'ERRORLOG ='|| ErrorLog || '\n';
type of thing when \n is your EOL marker (in this case unix)
gives:-
<Data>
SENDERID =2131
RECIEVERID=abcdef
MAPNAME =ABCMAP
ERRORLOG =LogDetails
</Data> |
|
Back to top |
|
 |
satya22777 |
Posted: Fri Sep 12, 2008 4:17 am Post subject: |
|
|
Apprentice
Joined: 03 Apr 2006 Posts: 31
|
Hi Smith,
Thanks for your Immediate responce, I tried with our suggestion. but i need plain text message in my body of email with out xml like:
SENDERID =2131
RECIEVERID =abcdef
MAPNAME = ABCMAP
ERRORLOG =LogDetails
thanks in advance. |
|
Back to top |
|
 |
satya22777 |
Posted: Fri Sep 12, 2008 4:25 am Post subject: |
|
|
Apprentice
Joined: 03 Apr 2006 Posts: 31
|
and one more thing..Mr.Smith,
I am getting message in streem before Email node is:
<?xml version="1.0" encoding="UTF-8"?>
<Error>
<MAPTYPE>INBOUND</MAPTYPE>
<SENDERID>2131</SENDERID>
<RECIEVERID>abcdef</RECIEVERID>
<MESSAGETYPE></MESSAGETYPE>
<MAPNAME>ABCMAP</MAPNAME>
<MAPSTATUS>FAILURE</MAPSTATUS>
<ERRORLOG></ERRORLOG>
</Error>
So I am passing this message to Emailout node. |
|
Back to top |
|
 |
MrSmith |
Posted: Fri Sep 12, 2008 6:35 am Post subject: |
|
|
 Master
Joined: 20 Mar 2008 Posts: 215
|
In which case i would suggest one of 2 things depending on the following:
If there is only ever these 4 fields then create an MRM with 4 elements with terminators of EOL or one element and in the ESQL do what i said earlier with the concat and EOL then ASBITSTREAM into single MRM element and then thats it it will format itself, rem that you need to ensure enough length on elements in MRM and say blank fill or have ellement as ref to another element that has total length value in it
so you would have something like
Set OutputRoot.MRM.Element[1] = InputBody.Error.SENDERID
Set OutputRoot.MRM.Element[2] = InputBody.Error.SENDERID
etc etc.
where in the MRM the terminator is \n (LF) or <CRLF> for windows
or
Set OutputRoot.MRM.Element = ASBITSTREAM(InputBody.Error.SENDERID || '\n' || InputBody.Error.SENDERID etc etc);
Prob not 100% correct in syntax etc but you get the idea |
|
Back to top |
|
 |
kimbert |
Posted: Fri Sep 12, 2008 7:50 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
If there is only ever these 4 fields then create an MRM with 4 elements with terminators of EOL or one element and in the ESQL do what i said earlier with the concat and EOL then ASBITSTREAM into single MRM element and then thats it it will format itself |
I strongly agree. You should be using a message set to do this kind of physical formatting of a message.
Quote: |
rem that you need to ensure enough length on elements in MRM and say blank fill or have ellement as ref to another element that has total length value in it |
Only if you use CWF. But that would be silly.
If you use TDS with Data Element Separation set to 'Tagged Delimited' then lengths will never be a problem. |
|
Back to top |
|
 |
satya22777 |
Posted: Fri Sep 12, 2008 9:05 am Post subject: |
|
|
Apprentice
Joined: 03 Apr 2006 Posts: 31
|
Hii Smith & Kimbert
Thanks for valuable suggestions.. |
|
Back to top |
|
 |
|