Question & Answer
Question
How to do exception grouping for asynchronous service? YIFErrorSequenceUE
Cause
Answer
This is the information the javadoc should include.
The class
implementing YIFErrorSequenceUE is invoked for each Asynchronous service with a
Receiver.
It is enabled by checking the "Check For Prior Exception" flag
and specifying the implementing class in Prior Errors User
Exit.
When this class in invoked, it is passed on the same Document that
the Receiver Component
(Like Database, MQJMS, etc) receives.
There
are two methods in this interface.
getExceptionGroupReference method is the
one invoked by the infrastructure, and it is expected to return a Document as
follows :
<Order
ExceptionGroupReferenceExists="N" OrderHeaderKey="2004080914385146615"
ExceptionGroupReference="something" />
Basically the same input xml, but
in the root of that, programmer should include this
attribute
ExceptionGroupReferenceExists="N"
ExceptionGroupReference="somet
hing"
ExceptionGroupReference is the one that specifies how this
particular message should be classified in case there is a reprocessible
exception.
The other method is setExceptionGroupFinder.
This method
can be written (overridden... yantra specifies a default implementation) to be
the *finder* of the exceptiongroup reference.
The following piece of
code explains it clearly :
package custom.UE ;
import
com.yantra.interop.japi.YIFErrorSequenceUE ;
import
com.yantra.interop.japi.YIFExceptionGroupFinder ;
import
com.yantra.yfc.dom.YFCDocument ;
import org.w3c.dom.Document
;
public class CustomErrorSequenceImpl implements
YIFErrorSequenceUE
{
private YIFExceptionGroupFinder finder = null
;
public void setExceptionGroupFinder(YIFExceptionGroupFinder
finder)
{
this.finder = finder ;
}
public
Document getExceptionGroupReference(Document inDoc,
String transactionName) throws Exception
{
System.out.println ( "Input Doc is " +
YFCDocument.getDocumentFor ( inDoc ).getString() ) ;
Document
outDoc = finder.findExistingError( inDoc ) ;
System.out.println
( "Output Doc is " +
YFCDocument.getDocumentFor ( outDoc
).getString() ) ;
return outDoc ;
}
}
Historical Number
PRI49373
Product Synonym
[<p><b>]Fact[</b><p>];
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21542471