use of org.activiti.engine.impl.persistence.entity.HistoricTaskInstanceEntity in project Activiti by Activiti.
the class GetHistoricIdentityLinksForTaskCmd method getLinksForTask.
@SuppressWarnings({ "unchecked", "rawtypes" })
protected List<HistoricIdentityLink> getLinksForTask(CommandContext commandContext) {
HistoricTaskInstanceEntity task = commandContext.getHistoricTaskInstanceEntityManager().findHistoricTaskInstanceById(taskId);
if (task == null) {
throw new ActivitiObjectNotFoundException("No historic task exists with the given id: " + taskId, HistoricTaskInstance.class);
}
List<HistoricIdentityLink> identityLinks = (List) commandContext.getHistoricIdentityLinkEntityManager().findHistoricIdentityLinksByTaskId(taskId);
// Similar to GetIdentityLinksForTask, return assignee and owner as identity link
if (task.getAssignee() != null) {
HistoricIdentityLinkEntity identityLink = new HistoricIdentityLinkEntity();
identityLink.setUserId(task.getAssignee());
identityLink.setTaskId(task.getId());
identityLink.setType(IdentityLinkType.ASSIGNEE);
identityLinks.add(identityLink);
}
if (task.getOwner() != null) {
HistoricIdentityLinkEntity identityLink = new HistoricIdentityLinkEntity();
identityLink.setTaskId(task.getId());
identityLink.setUserId(task.getOwner());
identityLink.setType(IdentityLinkType.OWNER);
identityLinks.add(identityLink);
}
return identityLinks;
}
use of org.activiti.engine.impl.persistence.entity.HistoricTaskInstanceEntity in project Activiti by Activiti.
the class DefaultHistoryManager method recordTaskCreated.
// Task related history
/* (non-Javadoc)
* @see org.activiti.engine.impl.history.HistoryManagerInterface#recordTaskCreated(org.activiti.engine.impl.persistence.entity.TaskEntity, org.activiti.engine.impl.persistence.entity.ExecutionEntity)
*/
@Override
public void recordTaskCreated(TaskEntity task, ExecutionEntity execution) {
if (isHistoryLevelAtLeast(HistoryLevel.AUDIT)) {
HistoricTaskInstanceEntity historicTaskInstance = new HistoricTaskInstanceEntity(task, execution);
getDbSqlSession().insert(historicTaskInstance);
}
}
Aggregations