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