use of eu.bcvsolutions.idm.acc.dto.SysProvisioningArchiveDto.Builder in project CzechIdMng by bcvsolutions.
the class DefaultSysProvisioningArchiveService method archive.
@Override
// we want log in archive always
@Transactional(propagation = Propagation.REQUIRES_NEW)
public SysProvisioningArchiveDto archive(SysProvisioningOperationDto provisioningOperation) {
Builder builder = new SysProvisioningArchiveDto.Builder(provisioningOperation);
if (provisioningOperation.getSystemEntity() != null) {
SysSystemEntityDto systemEntity = systemEntityService.get(provisioningOperation.getSystemEntity());
builder.setSystemEntityUid(systemEntity.getUid());
}
SysProvisioningArchiveDto archive = builder.build();
// preserve original operation creator
archive.setCreator(provisioningOperation.getCreator());
archive.setCreatorId(provisioningOperation.getCreatorId());
archive.setOriginalCreator(provisioningOperation.getOriginalCreator());
archive.setOriginalCreatorId(provisioningOperation.getOriginalCreatorId());
return save(archive);
}
Aggregations