Search in sources :

Example 1 with TaskVariableIndexer

use of org.kie.internal.task.api.TaskVariableIndexer in project jbpm by kiegroup.

the class TaskIndexerManager method index.

public List<TaskVariable> index(Task task, String variableName, Object variable) {
    for (TaskVariableIndexer indexer : indexers) {
        if (indexer.accept(variable)) {
            List<TaskVariable> indexed = indexer.index(variableName, variable);
            if (indexed != null) {
                // populate all indexed variables with task information
                for (TaskVariable taskVariable : indexed) {
                    taskVariable.setTaskId(task.getId());
                    taskVariable.setTaskId(task.getId());
                    taskVariable.setProcessInstanceId(task.getTaskData().getProcessInstanceId());
                    taskVariable.setProcessId(task.getTaskData().getProcessId());
                    taskVariable.setModificationDate(new Date());
                }
                return indexed;
            }
        }
    }
    return null;
}
Also used : TaskVariable(org.kie.internal.task.api.TaskVariable) Date(java.util.Date) TaskVariableIndexer(org.kie.internal.task.api.TaskVariableIndexer)

Aggregations

Date (java.util.Date)1 TaskVariable (org.kie.internal.task.api.TaskVariable)1 TaskVariableIndexer (org.kie.internal.task.api.TaskVariableIndexer)1