Search in sources :

Example 11 with HalResource

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

the class HalTaskList method fromTaskList.

public static HalTaskList fromTaskList(List<Task> tasks, long count) {
    HalTaskList taskList = new HalTaskList();
    // embed tasks
    List<HalResource<?>> embeddedTasks = new ArrayList<HalResource<?>>();
    for (Task task : tasks) {
        embeddedTasks.add(HalTask.fromTask(task));
    }
    taskList.addEmbedded("task", embeddedTasks);
    // links
    taskList.addLink("self", fromPath(TaskRestService.PATH).build());
    taskList.count = count;
    return taskList;
}
Also used : Task(org.camunda.bpm.engine.task.Task) ArrayList(java.util.ArrayList) HalResource(org.camunda.bpm.engine.rest.hal.HalResource)

Aggregations

HalResource (org.camunda.bpm.engine.rest.hal.HalResource)11 ArrayList (java.util.ArrayList)9 IdentityService (org.camunda.bpm.engine.IdentityService)3 User (org.camunda.bpm.engine.identity.User)3 HashMap (java.util.HashMap)2 RepositoryService (org.camunda.bpm.engine.RepositoryService)2 AbstractRestServiceTest (org.camunda.bpm.engine.rest.AbstractRestServiceTest)2 HalLinkResolver (org.camunda.bpm.engine.rest.hal.HalLinkResolver)2 DefaultHalResourceCache (org.camunda.bpm.engine.rest.hal.cache.DefaultHalResourceCache)2 HalRelationCacheConfiguration (org.camunda.bpm.engine.rest.hal.cache.HalRelationCacheConfiguration)2 IdentityLink (org.camunda.bpm.engine.task.IdentityLink)2 Test (org.junit.Test)2 Matchers.anyString (org.mockito.Matchers.anyString)2 TaskService (org.camunda.bpm.engine.TaskService)1 Group (org.camunda.bpm.engine.identity.Group)1 Tenant (org.camunda.bpm.engine.identity.Tenant)1 UserQuery (org.camunda.bpm.engine.identity.UserQuery)1 CaseDefinition (org.camunda.bpm.engine.repository.CaseDefinition)1 ProcessDefinition (org.camunda.bpm.engine.repository.ProcessDefinition)1 Cache (org.camunda.bpm.engine.rest.cache.Cache)1