use of org.jbpm.services.task.identity.MvelUserGroupCallbackImpl in project jbpm by kiegroup.
the class HumanTaskConfigurator method getTaskService.
@SuppressWarnings("unchecked")
public TaskService getTaskService() {
if (service == null) {
TaskEventSupport taskEventSupport = new TaskEventSupport();
this.commandExecutor = new TaskCommandExecutorImpl(this.environment, taskEventSupport);
if (userGroupCallback == null) {
userGroupCallback = new MvelUserGroupCallbackImpl(true);
}
environment.set(EnvironmentName.TASK_USER_GROUP_CALLBACK, userGroupCallback);
if (userInfo == null) {
userInfo = new DefaultUserInfo(true);
}
environment.set(EnvironmentName.TASK_USER_INFO, userInfo);
addDefaultInterceptor();
addTransactionLockInterceptor();
addOptimisticLockInterceptor();
addErrorHandlingInterceptor();
for (PriorityInterceptor pInterceptor : interceptors) {
this.commandExecutor.addInterceptor(pInterceptor.getInterceptor());
}
service = new CommandBasedTaskService(this.commandExecutor, taskEventSupport, this.environment);
// register listeners
for (TaskLifeCycleEventListener listener : listeners) {
((EventService<TaskLifeCycleEventListener>) service).registerTaskEventListener(listener);
}
if (AssignmentServiceProvider.get().isEnabled()) {
((EventService<TaskLifeCycleEventListener>) service).registerTaskEventListener(new AssignmentTaskEventListener());
}
// initialize deadline service with command executor for processing
if (TaskDeadlinesServiceImpl.getInstance() == null) {
TaskDeadlinesServiceImpl.initialize(commandExecutor);
}
}
return service;
}
Aggregations