Welcome Guest ( Log In | Register )


 
Reply to this topicNew Topic
email from mapping, How to send an email in case of a mapping error
RobL
post Jun 7 2010, 07:55 AM
Post #1


Visitor
*

Group: Members
Posts: 6
Joined: 17-May 10
Member No.: 1,310


Hi guys,

Can anyone tell me if it is possible to configure xib such that it isable to send an email in case of an error during conversion to inform certain people of the fact that an error has occurred?

Thx
Rob
Go to the top of the page
 
+Quote Post
Kavindra Kulathi...
post Jun 7 2010, 10:12 AM
Post #2


Regular Contributor
***

Group: Members
Posts: 47
Joined: 6-November 08
From: Colombo, Sri Lanaka
Member No.: 55


Hi,

yes this can be done, attachement is an MBC written by XIB exprt, use this on a sequential activity after the mapping, this will direct to the next activity when there is an error in the mapping,

you could decalre a common attributes to capture errors in the map as in below code and attach it to pass to your email overriding MBC..etc

WHEN "DMevent_ErrorBeforeCloseOutput"
{
$noOfErrs=DMU.GetNrOfErrors();
FOR $i=1 TO $noOfErrs {
$errCode[$i]="";
$errDesc[$i]="";
DMU.GetError $i ERRORCODE $errCode[$i] ERROR $errDesc[$i];
}

$errDescStr = $errDesc[1];
$errActivity = MBC_HIERCHMSGENV.GetActivityName($SessionId, $MessageId);

PassErrorToNextActivity $errDescStr ERRORACTIVITY $errActivity;
}

WHEN "DMevent_AfterWriteOutput"
{
DMU.GetOutputMessageIds "" SESSIONID $SessionId MESSAGEIDS $outMessageIds;
MBC_HIERCHMSGENV.SetLoggerId $SessionId MessageId $outMessageIds[1] LoggerId $inLoggerID;
}


.....
....

#------------------------------------------------------------------------
# Statement: PassErrorToNextActivity
#------------------------------------------------------------------------

DECLARE STATEMENT PassErrorToNextActivity IN $errDescription PRIMITIVE ERRORACTIVITY IN $errorActivity PRIMITIVE

{

DECLARE $hData RECORD DATAIO.Handle;

DATAIO.AttachString $hData String "";

MBC_HIERCHMSGENV.AttachData $SessionId MessageId $MessageId Data $hData;

COMMON.SetError $SessionId
MessageId $MessageId
ErrorCode COMMON.$ErrorCode_InvalidFileFormat
Description "xxxxxx: " & $errDescription
Activity $errorActivity;

RETURN;

}


--------------------
Kavindra Kulathilake

Mobile: +94 777 419 025
Tel: +94 11 2662255-8, 2662331-2
Fax:+94 11 2662333, 2662334
kavindra.kulathilake@ebuilder.lk
www.ebuilder.com

eBuilder Technology Centre
95, Dr. N M Perera Mawatha,
Colombo 8 ,Sri Lanka

MSN : Kavindra_Kulathilaka@hotmail.com
Go to the top of the page
 
+Quote Post
Rhenus ICT Servi...
post Jun 11 2010, 11:46 AM
Post #3


Regular Contributor
***

Group: Members
Posts: 33
Joined: 6-November 08
Member No.: 82


Hi,

The code Kavindra supplied to us is very interesting indeed.

I did something similar in my own custom maincode, but with a small
difference; instead of putting code in the Event-handling part of the maincode
I put some error-trapping code in the ExecuteMap part of the maincode, like this:

CODE
# --------------------------------------- Main - Execute
DECLARE PUBLIC STATEMENT ExecuteMap {
    TRY {

%ACTIVATECODE

    }
    CATCH $exception
    WHEN OTHERS {
      # All errors during the conversion are trapped here

-------> PUT YOUR CUSTOM ERROR TRAPPING CODE HERE <--------

%ERRORCODE
    }


Good Luck!

P.S. Mapping error handling would be really improved if Axway modified the mapping-stage MBC GUI, so a Next Activity could be selected in the 'Error Handling' parts of the mapping MBC window with the errors contained in Error Attributes and the original erroneous message as message-data

But that's probably just wishfull thinking rolleyes.gif
Go to the top of the page
 
+Quote Post
RobL
post Aug 9 2010, 09:16 AM
Post #4


Visitor
*

Group: Members
Posts: 6
Joined: 17-May 10
Member No.: 1,310


Hi Guys,

Thanks very much for the replies. This very helpful.

I am new to the forum, did not receive any response so I thought the topic had been forgotten, but obviously it has not!
Go to the top of the page
 
+Quote Post

Reply to this topicNew Topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Skin designed by IPB Forum Skins