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 WorkflowRuntimeException("The notification should have " + NOTIFICATION_SOURCE_TAG + " element.");
}
String workflowInstanceID = notificationSource.attributeValue(WOR_NS, SERVICE_ID_ATTRIBUTE);
if (workflowInstanceID == null) {
throw new WorkflowRuntimeException("The notification should have " + SERVICE_ID_ATTRIBUTE + " attribute.");
}
try {
return new URI(workflowInstanceID);
} catch (URISyntaxException e) {
throw new WorkflowRuntimeException(e);
}
}