}
protected void sendNotification(WorkflowTrackingContext context, XmlObject xmldata,
String[] descriptionAndAnnotation, String defaultDesc) {
BaseNotificationType xmlMessage = XmlBeanUtils.extractBaseNotificationType(xmldata);
NotificationPublisher publisher = publishermap.get(context.getBrokerEpr());
try {
if (publisher == null) {
// if a publisher class name has been defined to override the default WSM publisher, use it
if (context.getPublisherImpl() != null) {
publisher = PublisherFactory.createSomePublisher(context.getPublisherImpl(), context);
} else {
if (context.getTopic() == null) {
publisher = new WSMPublisher(100, context.isEnableAsyncPublishing(), context.getBrokerEpr()
.getAddress(), false);
} else {
publisher = new WSMPublisher(100, context.isEnableAsyncPublishing(), context.getBrokerEpr()
.getAddress(), context.getTopic());
}
}
publishermap.put(context.getBrokerEpr(), publisher);
}
setIDAndTimestamp(context, xmlMessage, context.getMyself(), activityTimestamp != null ? activityTimestamp
: new Date());
setDescAndAnno(context, xmlMessage, descriptionAndAnnotation, defaultDesc);
xmlMessage.getNotificationSource().setExperimentID(context.getTopic());
// System.out.println(xmldata);
if (log.isDebugEnabled()) {
log.debug(xmldata.toString());
}
publisher.publish(xmldata);
} catch (RuntimeException e) {
throw new WorkflowTrackingException(e);
} catch (IOException e) {
throw new WorkflowTrackingException(e);
}