Search in sources :

Example 1 with LoadBalanceAssignmentStrategy

use of org.jbpm.services.task.assignment.impl.strategy.LoadBalanceAssignmentStrategy in project jbpm by kiegroup.

the class TotalCompletionTimeAssignmentStrategyTest method setUp.

@Before
public void setUp() throws Exception {
    System.setProperty("org.jbpm.task.assignment.enabled", "true");
    System.setProperty("org.jbpm.task.assignment.strategy", "LoadBalance");
    System.setProperty("org.jbpm.task.assignment.loadbalance.calculator", "org.jbpm.services.task.assignment.impl.TotalCompletionTimeLoadCalculator");
    System.setProperty("org.jbpm.services.task.assignment.taskduration.timetolive", "1000");
    pds = setupPoolingDataSource();
    emf = Persistence.createEntityManagerFactory("org.jbpm.services.task");
    AssignmentServiceProvider.override(new LoadBalanceAssignmentStrategy());
    this.taskService = (InternalTaskService) HumanTaskServiceFactory.newTaskServiceConfigurator().entityManagerFactory(emf).listener(new JPATaskLifeCycleEventListener(true)).listener(new BAMTaskEventListener(true)).getTaskService();
    // giving ourselves lots of room
    taskIds = new Long[100];
    forceBAMEntries();
}
Also used : JPATaskLifeCycleEventListener(org.jbpm.services.task.audit.JPATaskLifeCycleEventListener) BAMTaskEventListener(org.jbpm.services.task.lifecycle.listeners.BAMTaskEventListener) LoadBalanceAssignmentStrategy(org.jbpm.services.task.assignment.impl.strategy.LoadBalanceAssignmentStrategy) Before(org.junit.Before)

Example 2 with LoadBalanceAssignmentStrategy

use of org.jbpm.services.task.assignment.impl.strategy.LoadBalanceAssignmentStrategy in project jbpm by kiegroup.

the class LoadBalanceAssignmentStrategyTest method setUp.

@Before
public void setUp() throws Exception {
    System.setProperty("org.jbpm.task.assignment.enabled", "true");
    System.setProperty("org.jbpm.task.assignment.strategy", "LoadBalance");
    System.setProperty("org.jbpm.task.assignment.loadbalance.calculator", "org.jbpm.services.task.assignment.impl.TaskCountLoadCalculator");
    // this has to be low in order that we update the load balances
    System.setProperty("org.jbpm.task.assignment.loadbalance.entry.timetolive", "10");
    pds = setupPoolingDataSource();
    emf = Persistence.createEntityManagerFactory("org.jbpm.services.task");
    AssignmentServiceProvider.override(new LoadBalanceAssignmentStrategy());
    this.taskService = (InternalTaskService) HumanTaskServiceFactory.newTaskServiceConfigurator().entityManagerFactory(emf).getTaskService();
    this.tasks = ArrayListMultimap.create();
}
Also used : LoadBalanceAssignmentStrategy(org.jbpm.services.task.assignment.impl.strategy.LoadBalanceAssignmentStrategy) Before(org.junit.Before)

Aggregations

LoadBalanceAssignmentStrategy (org.jbpm.services.task.assignment.impl.strategy.LoadBalanceAssignmentStrategy)2 Before (org.junit.Before)2 JPATaskLifeCycleEventListener (org.jbpm.services.task.audit.JPATaskLifeCycleEventListener)1 BAMTaskEventListener (org.jbpm.services.task.lifecycle.listeners.BAMTaskEventListener)1