de.uni.freiburg.iig.telematik.sewol.log.LogSummary Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of SEWOL Show documentation
Show all versions of SEWOL Show documentation
SEWOL provides support for the handling of workflow traces. Specifically it allows to specify the shape and content of process traces in terms of entries representing the execution of a specific workflow activity. SEWOL also allows to write these traces on disk as a log file with the help of a special file writer for process logs. Currently it supports plain text, Petrify, MXML and XES log file types. In order to specify security-related context information, SEWOL provides access control models such as access control lists (ACL) and role-based access control models (RBAC). All types of models can be conveniently edited with the help of appropriate dialogs.
package de.uni.freiburg.iig.telematik.sewol.log;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import de.invation.code.toval.statistic.Observation;
import de.invation.code.toval.validate.ParameterException;
import de.invation.code.toval.validate.Validate;
public class LogSummary {
private final Set activities = new HashSet<>();
private final Set originators = new HashSet<>();
private final Set roles = new HashSet<>();
private final Observation traceLength = new Observation();
public LogSummary() {}
public LogSummary(List> traces) throws ParameterException {
addTraces(traces);
}
public void addTraces(List> traces) throws ParameterException {
Validate.notNull(traces);
for(LogTrace trace: traces){
addTrace(trace);
}
}
public void addTrace(LogTrace trace) throws ParameterException{
Validate.notNull(trace);
activities.addAll(trace.getDistinctActivities());
originators.addAll(trace.getDistinctOriginators());
roles.addAll(trace.getDistinctRoles());
traceLength.addValue(trace.size());
}
public Set getActivities() {
return Collections.unmodifiableSet(activities);
}
public Set getOriginators() {
return Collections.unmodifiableSet(originators);
}
public Set getRoles() {
return Collections.unmodifiableSet(roles);
}
public double getAverageTraceLength(){
return traceLength.getAverage();
}
}