| 240 | } |
| 241 | |
| 242 | void Processor::onTrigger(ProcessContext *context, ProcessSessionFactory *sessionFactory) { |
| 243 | auto session = sessionFactory->createSession(); |
| 244 | |
| 245 | try { |
| 246 | // Call the virtual trigger function |
| 247 | onTrigger(context, session.get()); |
| 248 | session->commit(); |
| 249 | } catch (std::exception &exception) { |
| 250 | logger_->log_warn("Caught \"%s\" (%s) during Processor::onTrigger of processor: %s (%s)", |
| 251 | exception.what(), typeid(exception).name(), getUUIDStr(), getName()); |
| 252 | session->rollback(); |
| 253 | throw; |
| 254 | } catch (...) { |
| 255 | logger_->log_warn("Caught unknown exception during Processor::onTrigger of processor: %s (%s)", getUUIDStr(), getName()); |
| 256 | session->rollback(); |
| 257 | throw; |
| 258 | } |
| 259 | } |
| 260 | |
| 261 | void Processor::onTrigger(const std::shared_ptr<ProcessContext> &context, const std::shared_ptr<ProcessSessionFactory> &sessionFactory) { |
| 262 | auto session = sessionFactory->createSession(); |