04-04-2013 05:32 AM
public final class TacheSuspendueTaskListener implements TaskListener {
@Autowired
private UtilisateurRepositoryService utilisateurRepositoryService;
@Autowired
private MoteurProcessusService moteurProcessusService;
@Autowired
private TaskService activitiTaskService;
@Override
public void notify(DelegateTask delegateTask) {
String lastAssignee = (String) delegateTask.getVariable("lastAssignee");
if (lastAssignee != null) {
List<Utilisateur> utilisateur = utilisateurRepositoryService.findByIdList(Lists.newArrayList(Long.valueOf(lastAssignee)));
try {
activitiTaskService.setAssignee(delegateTask.getId(), utilisateur.iterator().next().getId());
} catch (ActivitiException ae) {
throw new ProcessEngineException("Unable to assign task with taskId={} to user with userId={}.", ae,
delegateTask.getId(), utilisateur.iterator().next().getId());
}
}
}
}
04-04-2013 05:47 AM
String lastAssignee = (String) delegateTask.getVariable("lastAssignee");
if (lastAssignee != null) {
List<Utilisateur> utilisateur = utilisateurRepositoryService.findByIdList(Lists.newArrayList(Long.valueOf(lastAssignee)));
try {
activitiTaskService.setAssignee(delegateTask.getId(), utilisateur.iterator().next().getId());
} catch (ActivitiException ae) {
throw new ProcessEngineException("Unable to assign task with taskId={} to user with userId={}.", ae,
delegateTask.getId(), utilisateur.iterator().next().getId());
}
04-04-2013 09:51 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.