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