use of com.evolveum.midpoint.xml.ns._public.common.common_3.ActivityActionsExecutedType in project midpoint by Evolveum.
the class ActionsExecutedSummarizer method summarize.
public ActivityActionsExecutedType summarize() {
// Note: key-related fields in value objects i.e. in ObjectActionsExecutedEntryType instances (objectType, channel, ...)
// are ignored in the following two maps.
Map<ActionsExecutedObjectsKey, ObjectActionsExecutedEntryType> allObjectActions = new HashMap<>();
Map<ActionsExecutedObjectsKey, ObjectActionsExecutedEntryType> resultingObjectActions = new HashMap<>();
allActions.forEach(action -> addAction(allObjectActions, action));
for (Map.Entry<String, List<ActionExecuted>> entry : actionsByOid.entrySet()) {
// Last non-modify operation determines the result
List<ActionExecuted> actions = entry.getValue();
assert actions.size() > 0;
int relevant;
for (relevant = actions.size() - 1; relevant >= 0; relevant--) {
if (actions.get(relevant).changeType != ChangeType.MODIFY) {
break;
}
}
if (relevant < 0) {
// all are "modify" -> take any (we currently don't care whether successful or not; TODO fix this)
ActionExecuted actionExecuted = actions.get(actions.size() - 1);
addAction(resultingObjectActions, actionExecuted);
} else {
addAction(resultingObjectActions, actions.get(relevant));
}
}
ActivityActionsExecutedType rv = new ActivityActionsExecutedType();
mapToBean(allObjectActions, rv.getObjectActionsEntry());
mapToBean(resultingObjectActions, rv.getResultingObjectActionsEntry());
return rv;
}
Aggregations