Search in sources :

Example 1 with MvelUserGroupCallbackImpl

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;
}
Also used : AssignmentTaskEventListener(org.jbpm.services.task.assignment.impl.AssignmentTaskEventListener) TaskCommandExecutorImpl(org.jbpm.services.task.commands.TaskCommandExecutorImpl) EventService(org.kie.internal.task.api.EventService) MvelUserGroupCallbackImpl(org.jbpm.services.task.identity.MvelUserGroupCallbackImpl) TaskEventSupport(org.jbpm.services.task.events.TaskEventSupport) CommandBasedTaskService(org.jbpm.services.task.impl.command.CommandBasedTaskService) DefaultUserInfo(org.jbpm.services.task.identity.DefaultUserInfo) TaskLifeCycleEventListener(org.kie.api.task.TaskLifeCycleEventListener)

Aggregations

AssignmentTaskEventListener (org.jbpm.services.task.assignment.impl.AssignmentTaskEventListener)1 TaskCommandExecutorImpl (org.jbpm.services.task.commands.TaskCommandExecutorImpl)1 TaskEventSupport (org.jbpm.services.task.events.TaskEventSupport)1 DefaultUserInfo (org.jbpm.services.task.identity.DefaultUserInfo)1 MvelUserGroupCallbackImpl (org.jbpm.services.task.identity.MvelUserGroupCallbackImpl)1 CommandBasedTaskService (org.jbpm.services.task.impl.command.CommandBasedTaskService)1 TaskLifeCycleEventListener (org.kie.api.task.TaskLifeCycleEventListener)1 EventService (org.kie.internal.task.api.EventService)1