Search in sources :

Example 1 with DefaultUserInfo

use of org.jbpm.services.task.identity.DefaultUserInfo in project jbpm by kiegroup.

the class EmailNotificationPublisherTest method setUp.

@Before
public void setUp() throws Exception {
    System.setProperty("org.jbpm.email.templates.dir", new File("src/test/resources/templates").getAbsolutePath());
    TemplateManager.reset();
    ChainedProperties props = ChainedProperties.getChainedProperties("email.conf", ClassLoaderUtil.getClassLoader(null, getClass(), false));
    emailHost = props.getProperty("mail.smtp.host", "localhost");
    emailPort = props.getProperty("mail.smtp.port", "2345");
    wiser = new Wiser();
    wiser.setHostname(emailHost);
    wiser.setPort(Integer.parseInt(emailPort));
    wiser.start();
    Thread.sleep(200);
    connection = new Connection(emailHost, emailPort);
    userInfo = new DefaultUserInfo(true);
}
Also used : Wiser(org.subethamail.wiser.Wiser) ChainedProperties(org.kie.internal.utils.ChainedProperties) File(java.io.File) DefaultUserInfo(org.jbpm.services.task.identity.DefaultUserInfo) Before(org.junit.Before)

Example 2 with DefaultUserInfo

use of org.jbpm.services.task.identity.DefaultUserInfo 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)

Example 3 with DefaultUserInfo

use of org.jbpm.services.task.identity.DefaultUserInfo in project jbpm by kiegroup.

the class AdminAPIsWithListenerTest method setUp.

@Before
public void setUp() throws Exception {
    super.setUp();
    emfTasks = Persistence.createEntityManagerFactory("org.jbpm.services.task");
    userInfo = new DefaultUserInfo(null);
}
Also used : DefaultUserInfo(org.jbpm.services.task.identity.DefaultUserInfo) Before(org.junit.Before)

Aggregations

DefaultUserInfo (org.jbpm.services.task.identity.DefaultUserInfo)3 Before (org.junit.Before)2 File (java.io.File)1 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 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 ChainedProperties (org.kie.internal.utils.ChainedProperties)1 Wiser (org.subethamail.wiser.Wiser)1