use of org.iobserve.analysis.behavior.models.data.BehaviorModelTable in project iobserve-analysis by research-iobserve.
the class BehaviorModelPreparation method executeEntryCallSequenceModel.
/**
* Execute case object instanceof EntryCallSequenceModel.
*
* @param userSessionCollectionModel
* entryCallSequenceModel
*/
private void executeEntryCallSequenceModel(final UserSessionCollectionModel userSessionCollectionModel) {
if (this.behaviorModelTable == null) {
this.sequenceModelCache.add(userSessionCollectionModel);
} else {
final List<UserSession> userSessions = userSessionCollectionModel.getUserSessions();
BehaviorModelPreparation.LOGGER.debug("Executing {}", userSessionCollectionModel.getClass());
BehaviorModelPreparation.LOGGER.debug("userSessions: {}", userSessions.size());
for (final UserSession userSession : userSessions) {
final BehaviorModelTable modelTable = this.behaviorModelTable.getClearedCopy(this.keepEmptyTransitions);
final List<EntryCallEvent> entryCalls = userSession.getEvents();
EntryCallEvent lastCall = null;
for (final EntryCallEvent eventCall : entryCalls) {
final boolean isAllowed = modelTable.isAllowedSignature(eventCall);
if (lastCall != null && isAllowed) {
modelTable.addTransition(lastCall, eventCall);
modelTable.addInformation(eventCall);
} else if (isAllowed) {
// only called at first valid event
// (condition lastCall == null is not needed
modelTable.addInformation(eventCall);
}
lastCall = isAllowed ? eventCall : lastCall;
}
this.outputPort.send(modelTable);
}
}
}
use of org.iobserve.analysis.behavior.models.data.BehaviorModelTable in project iobserve-analysis by research-iobserve.
the class BehaviorModelTableGenerationStage method onTerminating.
@Override
public void onTerminating() {
final BehaviorModelTable fixedTable = this.modelTable.toClearedFixedSizeBehaviorModelTable(this.keepEmptyTransitions);
this.outputPort.send(fixedTable);
super.onTerminating();
}
use of org.iobserve.analysis.behavior.models.data.BehaviorModelTable in project iobserve-analysis by research-iobserve.
the class BehaviorModelPreparation method execute.
@Override
protected void execute(final Object object) {
if (object instanceof UserSessionCollectionModel) {
final UserSessionCollectionModel entryCallSequenceModel = (UserSessionCollectionModel) object;
this.executeEntryCallSequenceModel(entryCallSequenceModel);
} else if (object instanceof BehaviorModelTable) {
final BehaviorModelTable modelTable = (BehaviorModelTable) object;
this.executeBehaviorModelTable(modelTable);
} else {
BehaviorModelPreparation.LOGGER.error("input is nether of type EntryCallSequenceModel nor BehaviorModelTable");
}
}
Aggregations