if (!(type == EventType.WORKFLOW_INITIALIZED || type == EventType.WORKFLOW_TERMINATED)) {
throw new IllegalArgumentException(
"Event must be an workflowInitialized type or an workflowTerminated type instead of "
+ type);
}
XmlElement notificationSource = event.element(WOR_NS,
NOTIFICATION_SOURCE_TAG);
if (notificationSource == null) {
throw new XBayaRuntimeException("The notification should have "
+ NOTIFICATION_SOURCE_TAG + " element.");
}
String workflowInstanceID = notificationSource.attributeValue(WOR_NS,
SERVICE_ID_ATTRIBUTE);
if (workflowInstanceID == null) {
throw new XBayaRuntimeException("The notification should have "
+ SERVICE_ID_ATTRIBUTE + " attribute.");
}