<commit_before>package ch.elexis.core.tasks.internal.service;

import java.util.List;

import ch.elexis.core.model.tasks.IIdentifiedRunnable;
import ch.elexis.core.services.IContextService;
import ch.elexis.core.services.IModelService;
import ch.elexis.core.services.IQuery;
import ch.elexis.core.services.IQuery.COMPARATOR;
import ch.elexis.core.tasks.model.ITaskDescriptor;
import ch.elexis.core.tasks.model.ModelPackage;

public class TaskServiceUtil {
	
	/**
	 * Load the (active) task descriptors for a given runnable we are responsible for (that is, assigned as
	 * runner)
	 * 
	 * @param identifiedRunnable
	 * @param taskModelService
	 * @param contextService
	 * @return
	 */
	List<ITaskDescriptor> loadForIdentifiedRunnable(IIdentifiedRunnable identifiedRunnable,
		IModelService taskModelService, IContextService contextService){
		IQuery<ITaskDescriptor> query = taskModelService.getQuery(ITaskDescriptor.class);
		query.and(ModelPackage.Literals.ITASK_DESCRIPTOR__ACTIVE, COMPARATOR.EQUALS, true);
		query.and(ModelPackage.Literals.ITASK_DESCRIPTOR__IDENTIFIED_RUNNABLE_ID, COMPARATOR.EQUALS,
			identifiedRunnable.getId());
		query.startGroup();
		query.and(ModelPackage.Literals.ITASK_DESCRIPTOR__RUNNER, COMPARATOR.EQUALS,
			contextService.getStationIdentifier());
		query.or(ModelPackage.Literals.ITASK_DESCRIPTOR__RUNNER, COMPARATOR.EQUALS, null);
		query.andJoinGroups();
		return query.execute();
	}
	
}
<commit_msg>[23238] TaskService do not incur manual tasks<commit_after>package ch.elexis.core.tasks.internal.service;

import java.util.List;

import ch.elexis.core.model.tasks.IIdentifiedRunnable;
import ch.elexis.core.services.IContextService;
import ch.elexis.core.services.IModelService;
import ch.elexis.core.services.IQuery;
import ch.elexis.core.services.IQuery.COMPARATOR;
import ch.elexis.core.tasks.model.ITaskDescriptor;
import ch.elexis.core.tasks.model.ModelPackage;
import ch.elexis.core.tasks.model.TaskTriggerType;

public class TaskServiceUtil {
	
	/**
	 * Load the (active) task descriptors for a given runnable we are responsible for (that is, assigned as
	 * runner). Task descriptors with {@link TaskTriggerType#MANUAL} are not considered.
	 * 
	 * @param identifiedRunnable
	 * @param taskModelService
	 * @param contextService
	 * @return
	 */
	List<ITaskDescriptor> loadForIdentifiedRunnable(IIdentifiedRunnable identifiedRunnable,
		IModelService taskModelService, IContextService contextService){
		IQuery<ITaskDescriptor> query = taskModelService.getQuery(ITaskDescriptor.class);
		query.and(ModelPackage.Literals.ITASK_DESCRIPTOR__ACTIVE, COMPARATOR.EQUALS, true);
		query.and(ModelPackage.Literals.ITASK_DESCRIPTOR__IDENTIFIED_RUNNABLE_ID, COMPARATOR.EQUALS,
			identifiedRunnable.getId());
		query.and(ModelPackage.Literals.ITASK_DESCRIPTOR__TRIGGER_TYPE, COMPARATOR.NOT_EQUALS,
			TaskTriggerType.MANUAL.ordinal());
		query.startGroup();
		query.and(ModelPackage.Literals.ITASK_DESCRIPTOR__RUNNER, COMPARATOR.EQUALS,
			contextService.getStationIdentifier());
		query.or(ModelPackage.Literals.ITASK_DESCRIPTOR__RUNNER, COMPARATOR.EQUALS, null);
		query.andJoinGroups();
		return query.execute();
	}
	
}

{'fraction_non_alphanumeric': 0.09968354430379747, 'fraction_numerical': 0.0015822784810126582, 'mean_word_length': 6.21689497716895, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3528067', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1016, 'n_words': 163}