/**
* @return
*/
public MeasurementEventImpl getManualMeasurementEvent() {
MeasurementEventImpl me = null;
ExecutionRecordImpl res = this.getExecutionRecordForSessionId();
if( res == null ) return null;
Set<MeasurementEventImpl> measurementEvents = res.getMeasurementEvents();
for( MeasurementEventImpl mee : measurementEvents ) {
if( mee.getAgent() != null && mee.getAgent().getType() == AgentType.USER ) {
me = mee;
}
}
// If none, create one and pass it back.
if( me == null ) {
log.info("Creating Manual Measurement Event.");
me = new MeasurementEventImpl(res);
res.getMeasurementEvents().add(me);
UserBean user = (UserBean)JSFUtil.getManagedObject("UserBean");
me.setAgent( new MeasurementAgent( user ));
ExperimentPersistencyImpl.getInstance();
ExperimentInspector.persistExperiment();
}
me.getMeasurements();
return me;
}