}
String eventId = operationModel.getEventId();
if (eventId == null) {
eventId = defaultOperation.getEventId();
}
KnowledgeOperation operation = new KnowledgeOperation(type, eventId);
mapExpressions(operationModel, operation);
if (operations.containsKey(name)) {
throw CommonKnowledgeMessages.MESSAGES.cannotRegisterOperation(type.toString(), name);
}
operations.put(name, operation);