url - AJAX : Passing null parameter in GET request -
i couldn't find anything, i'm asking here little help! i'm sure it's super easy i'm stucked anyway.
i've created mvc application in order gather data (in ajax) camunda via rest api. 1 property of stuff (tasks, more precise) need "assignee". value filled username, can empty (in case, it's filled "null").
but here's problem: can't manage gather tasks value (in fact, i'd display each task of given user, including tasks not assigned anyone, can claim them if want to). url use in ajax this:
http://localhost:8080/engine-rest/task?assignee=peter
i've tried these parameters no success (no task displayed @ ; peter's, obvisouly):
task?assignee=peter%2cundefined task?assignee=peter%00 task?assignee=peter%2cnull
any ideas?
i don't think doable via camunda rest api. if not mistaken, there no way specifying condition assignee = peter or assignee null
.
i can think of 2 options:
1. make 2 queries
one task?assignee=peter
, task?unassigned=true
, join lists (they should disjunctive). see http://docs.camunda.org/latest/api-references/rest/#task-get-tasks description of parameters.
2. make native query using java api
native queries allow express arbitrary conditions, can performed using java api. see http://docs.camunda.org/latest/guides/user-guide/#process-engine-process-engine-api-native-queries details on native queries.
in example, code be
list<task> tasks = taskservice.createnativetaskquery() .sql("select count(*) " + managementservice.gettablename(task.class) + " t t.assignee_ = #{assignee} or t.assignee_ null") .parameter("assignee", "peter") .list();
if want expose in rest api, embedding , extending resources in custom jax-rs application way go, see http://docs.camunda.org/latest/api-references/rest/#overview-embedding-the-api
Comments
Post a Comment