Search in sources :

Example 11 with ChangeLog

use of org.finos.waltz.model.changelog.ChangeLog in project waltz by khartec.

the class ScenarioService method writeLogEntriesForCloningOperation.

private void writeLogEntriesForCloningOperation(CloneScenarioCommand command, Scenario clonedScenario) {
    String message = String.format("Created cloned scenario: '%s'", command.newName());
    ChangeLog logEntry = mkBasicLogEntry(command.scenarioId(), message, command.userId());
    changeLogService.write(logEntry);
    changeLogService.write(ImmutableChangeLog.copyOf(logEntry).withParentReference(EntityReference.mkRef(EntityKind.ROADMAP, clonedScenario.roadmapId())));
}
Also used : ImmutableChangeLog(org.finos.waltz.model.changelog.ImmutableChangeLog) ChangeLog(org.finos.waltz.model.changelog.ChangeLog)

Example 12 with ChangeLog

use of org.finos.waltz.model.changelog.ChangeLog in project waltz by khartec.

the class DataTypeUsageService method logChange.

private void logChange(String userId, EntityReference ref, String message) {
    ChangeLog changeLogEntry = ImmutableChangeLog.builder().parentReference(ref).message(message).severity(Severity.INFORMATION).userId(userId).childKind(EntityKind.LOGICAL_DATA_FLOW).operation(Operation.UPDATE).build();
    changeLogService.write(changeLogEntry);
}
Also used : ImmutableChangeLog(org.finos.waltz.model.changelog.ImmutableChangeLog) ChangeLog(org.finos.waltz.model.changelog.ChangeLog)

Example 13 with ChangeLog

use of org.finos.waltz.model.changelog.ChangeLog in project waltz by khartec.

the class CustomEnvironmentService method remove.

public Boolean remove(Long envId, String username) throws InsufficientPrivelegeException {
    CustomEnvironment env = customEnvironmentDao.getById(envId);
    ensureUserHasPermission(env, username, Operation.REMOVE);
    boolean removed = customEnvironmentDao.remove(envId);
    if (removed) {
        String message = format("Deleted custom environment: %s/%s and any mappings to assets", env.groupName(), env.name());
        ChangeLog changeLog = mkChangeLog(env.owningEntity(), username, message, Operation.REMOVE);
        changeLogService.write(changeLog);
    }
    return removed;
}
Also used : ImmutableChangeLog(org.finos.waltz.model.changelog.ImmutableChangeLog) ChangeLog(org.finos.waltz.model.changelog.ChangeLog) CustomEnvironment(org.finos.waltz.model.custom_environment.CustomEnvironment)

Example 14 with ChangeLog

use of org.finos.waltz.model.changelog.ChangeLog in project waltz by khartec.

the class FlowClassificationRuleService method multiLog.

private void multiLog(String username, Long classificationRuleId, EntityReference parentRef, DataType dataType, Application app, String msg, Operation operation) {
    ChangeLog parentLog = ImmutableChangeLog.builder().message(msg).severity(Severity.INFORMATION).userId(username).parentReference(parentRef).childKind(EntityKind.FLOW_CLASSIFICATION_RULE).operation(operation).build();
    ChangeLog appLog = ImmutableChangeLog.copyOf(parentLog).withParentReference(app.entityReference());
    ChangeLog dtLog = ImmutableChangeLog.copyOf(parentLog).withParentReference(dataType.entityReference());
    ChangeLog authLog = ImmutableChangeLog.copyOf(parentLog).withParentReference(mkRef(EntityKind.FLOW_CLASSIFICATION_RULE, classificationRuleId));
    changeLogService.write(parentLog);
    changeLogService.write(appLog);
    changeLogService.write(dtLog);
    changeLogService.write(authLog);
}
Also used : ImmutableChangeLog(org.finos.waltz.model.changelog.ImmutableChangeLog) ChangeLog(org.finos.waltz.model.changelog.ChangeLog)

Example 15 with ChangeLog

use of org.finos.waltz.model.changelog.ChangeLog in project waltz by khartec.

the class EntityNamedNoteTypeService method logMsg.

private void logMsg(Long id, String username, Operation op, String msg) {
    ChangeLog logEntry = ImmutableChangeLog.builder().userId(username).parentReference(EntityReference.mkRef(EntityKind.ENTITY_NAMED_NOTE_TYPE, id)).operation(op).message(msg).severity(Severity.INFORMATION).build();
    changeLogService.write(logEntry);
}
Also used : ImmutableChangeLog(org.finos.waltz.model.changelog.ImmutableChangeLog) ChangeLog(org.finos.waltz.model.changelog.ChangeLog)

Aggregations

ChangeLog (org.finos.waltz.model.changelog.ChangeLog)18 ImmutableChangeLog (org.finos.waltz.model.changelog.ImmutableChangeLog)18 String.format (java.lang.String.format)3 java.util (java.util)3 Collectors (java.util.stream.Collectors)3 Checks.checkNotNull (org.finos.waltz.common.Checks.checkNotNull)3 org.finos.waltz.model (org.finos.waltz.model)3 EntityReference.mkRef (org.finos.waltz.model.EntityReference.mkRef)3 CustomEnvironment (org.finos.waltz.model.custom_environment.CustomEnvironment)3 ChangeLogService (org.finos.waltz.service.changelog.ChangeLogService)3 Autowired (org.springframework.beans.factory.annotation.Autowired)3 Service (org.springframework.stereotype.Service)3 MapUtilities (org.finos.waltz.common.MapUtilities)2 StringUtilities (org.finos.waltz.common.StringUtilities)2 GenericSelector (org.finos.waltz.data.GenericSelector)2 GenericSelectorFactory (org.finos.waltz.data.GenericSelectorFactory)2 AssessmentDefinitionDao (org.finos.waltz.data.assessment_definition.AssessmentDefinitionDao)2 AssessmentRatingDao (org.finos.waltz.data.assessment_rating.AssessmentRatingDao)2 RatingSchemeDAO (org.finos.waltz.data.rating_scheme.RatingSchemeDAO)2 AssessmentDefinition (org.finos.waltz.model.assessment_definition.AssessmentDefinition)2