Search in sources :

Example 1 with HalTask

use of org.camunda.bpm.engine.rest.hal.task.HalTask in project camunda-bpm-platform by camunda.

the class FilterResourceImpl method convertToHalTaskList.

@SuppressWarnings("unchecked")
protected HalTaskList convertToHalTaskList(List<Task> tasks, long count) {
    HalTaskList halTasks = HalTaskList.generate(tasks, count, getProcessEngine());
    Map<String, List<VariableInstance>> variableInstances = getVariableInstancesForTasks(halTasks);
    if (variableInstances != null) {
        for (HalTask halTask : (List<HalTask>) halTasks.getEmbedded("task")) {
            embedVariableValuesInHalTask(halTask, variableInstances);
        }
    }
    return halTasks;
}
Also used : HalTask(org.camunda.bpm.engine.rest.hal.task.HalTask) HalTaskList(org.camunda.bpm.engine.rest.hal.task.HalTaskList) HalTaskList(org.camunda.bpm.engine.rest.hal.task.HalTaskList)

Example 2 with HalTask

use of org.camunda.bpm.engine.rest.hal.task.HalTask in project camunda-bpm-platform by camunda.

the class FilterResourceImpl method getVariableScopeIds.

protected LinkedHashSet<String> getVariableScopeIds(HalTask... halTasks) {
    // collect scope ids
    // the ordering is important because it specifies which variables are visible from a single task
    LinkedHashSet<String> variableScopeIds = new LinkedHashSet<String>();
    if (halTasks != null && halTasks.length > 0) {
        for (HalTask halTask : halTasks) {
            variableScopeIds.add(halTask.getId());
            variableScopeIds.add(halTask.getExecutionId());
            variableScopeIds.add(halTask.getProcessInstanceId());
            variableScopeIds.add(halTask.getCaseExecutionId());
            variableScopeIds.add(halTask.getCaseInstanceId());
        }
    }
    // remove null from set which was probably added due an unset id
    variableScopeIds.remove(null);
    return variableScopeIds;
}
Also used : HalTask(org.camunda.bpm.engine.rest.hal.task.HalTask)

Example 3 with HalTask

use of org.camunda.bpm.engine.rest.hal.task.HalTask in project camunda-bpm-platform by camunda.

the class FilterResourceImpl method convertToHalTask.

@SuppressWarnings("unchecked")
protected HalTask convertToHalTask(Task task) {
    HalTask halTask = HalTask.generate(task, getProcessEngine());
    Map<String, List<VariableInstance>> variableInstances = getVariableInstancesForTasks(halTask);
    if (variableInstances != null) {
        embedVariableValuesInHalTask(halTask, variableInstances);
    }
    return halTask;
}
Also used : HalTask(org.camunda.bpm.engine.rest.hal.task.HalTask) HalTaskList(org.camunda.bpm.engine.rest.hal.task.HalTaskList)

Aggregations

HalTask (org.camunda.bpm.engine.rest.hal.task.HalTask)3 HalTaskList (org.camunda.bpm.engine.rest.hal.task.HalTaskList)2