Bug #416

Subscription: Parameter override

Added by Roman Köhler over 1 year ago. Updated 7 months ago.

Status:Closed Start date:07/11/2010
Priority:(P3) Normal Due date:
Assignee:Roman Köhler % Done:

0%

Category:-
Target version:0.9.0-alpha1
Severity:Normal Target:
Story points-
Velocity based estimate-

Description

when a raise-eventsubscription has a _override parameter, it should be transfered to the event, regardless what is set before ... also _default parameter should be provided to the raised event

If you look at that code-snippet als the second line before end ( newEvent->setProperties(_event.getProperties());)
, you will clearly see, that all _default parameters and _override parameters are completly wasted. please 1. move up the line one time and 2. make a "adding" instead of "replacing" call

void EventInterpreterPluginRaiseEvent::handleEvent(Event& _event, const EventSubscription& _subscription) {
boost::shared_ptr<Event> newEvent(new Event(_subscription.getOptions().getParameter("event_name")));
if(_subscription.getOptions().hasParameter("time")) {
std::string timeParam = _subscription.getOptions().getParameter("time");
if(!timeParam.empty()) {
Logger::getInstance()->log("RaiseEvent: Event has time");
newEvent->setTime(timeParam);
}
}
applyOptionsWithSuffix(_subscription.getOptions(), "_default", newEvent);
if(_subscription.getOptions().hasParameter(EventPropertyLocation)) {
std::string location = _subscription.getOptions().getParameter(EventPropertyLocation);
if(!location.empty()) {
Logger::getInstance()->log("RaiseEvent: Event has location");
newEvent->setLocation(location);
}
}
applyOptionsWithSuffix(_subscription.getOptions(), "_override", newEvent);
newEvent->setProperties(_event.getProperties());
getEventInterpreter().getQueue().pushEvent(newEvent);
} // handleEvent

Associated revisions

Revision bdae71be
Added by Patrick Stählin over 1 year ago

Fixed raise_events override/default options

Fixes #416

History

Updated by Miguel Rodriguez over 1 year ago

  • Status changed from New to Assigned
  • Assignee set to Patrick Stählin
  • Target version set to 0.9.0-alpha1

Updated by Patrick Stählin over 1 year ago

  • Status changed from Assigned to Resolved
  • Assignee changed from Patrick Stählin to Roman Köhler

Updated by Michael Troß over 1 year ago

  • Status changed from Resolved to Closed

as agreed upon

Also available in: Atom PDF