Search in sources :

Example 1 with TaskIndexerManager

use of org.jbpm.services.task.audit.variable.TaskIndexerManager in project jbpm by kiegroup.

the class JPATaskLifeCycleEventListener method indexAndPersistVariables.

protected void indexAndPersistVariables(Task task, Map<String, Object> variables, TaskPersistenceContext persistenceContext, VariableType type) {
    TaskIndexerManager manager = TaskIndexerManager.get();
    for (Map.Entry<String, Object> variable : variables.entrySet()) {
        if (SKIPPED_TASK_VARIABLES.contains(variable.getKey()) || variable.getValue() == null) {
            continue;
        }
        List<TaskVariable> taskVars = manager.index(task, variable.getKey(), variable.getValue());
        if (taskVars != null) {
            for (TaskVariable tVariable : taskVars) {
                tVariable.setType(type);
                persistenceContext.persist(tVariable);
            }
        }
    }
}
Also used : TaskIndexerManager(org.jbpm.services.task.audit.variable.TaskIndexerManager) TaskVariable(org.kie.internal.task.api.TaskVariable) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

HashMap (java.util.HashMap)1 Map (java.util.Map)1 TaskIndexerManager (org.jbpm.services.task.audit.variable.TaskIndexerManager)1 TaskVariable (org.kie.internal.task.api.TaskVariable)1