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);
}
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;
}
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);
}
Aggregations