Fixed
Details
Assignee
Seth LegerSeth LegerReporter
Michael BatzMichael BatzComponents
Fix versions
Affects versions
Priority
Trivial
Details
Details
Assignee
Seth Leger
Seth LegerReporter
Michael Batz
Michael BatzComponents
Fix versions
Affects versions
Priority
PagerDuty
PagerDuty
PagerDuty
Created June 11, 2015 at 11:13 AM
Updated July 1, 2015 at 3:04 PM
Resolved July 1, 2015 at 11:46 AM
I'm creating some Drools rules for some extended event translation. For that reason I wanted to use the EventBuilder class to set some existing event parameters of an event to a new value. I tried to use the setParam() method of EventBuilder and saw, that an existing event parameter did not get a new value, instead, a new event parameter with the same name was added.
After a look into the source code:
public EventBuilder setParam(final String parmName, final String val) { if (m_event.getParmCollection().size() < 1) { return addParam(parmName, val); } for(final Parm parm : m_event.getParmCollection()) { if (parm.getParmName().equals(val)) { final Value value = new Value(); value.setContent(val); parm.setValue(value); return this; } }
I think, the condition in the second if() sould be
parm.getParmName().equals(parmName)