use of org.apache.synapse.aspects.flow.statistics.log.templates.FaultEvent in project wso2-synapse by wso2.
the class FaultStatisticCollector method reportFault.
/**
* Enqueue Fault Event to the event queue indicating that fault has occurred in the message flow.
*
* @param messageContext messageContext of the message flow.
*/
public static void reportFault(MessageContext messageContext) {
if (shouldReportStatistic(messageContext)) {
boolean isFaultCreated = isFaultAlreadyReported(messageContext);
if (!isFaultCreated) {
BasicStatisticDataUnit dataUnit = new BasicStatisticDataUnit();
dataUnit.setStatisticId(StatisticDataCollectionHelper.getStatisticTraceId(messageContext));
dataUnit.setCurrentIndex(StatisticDataCollectionHelper.getParentFlowPosition(messageContext, null));
FaultEvent faultEvent = new FaultEvent(dataUnit);
addEventAndIncrementCount(messageContext, faultEvent);
}
}
}
Aggregations