cancel
Showing results for 
Search instead for 
Did you mean: 

Rest IdentityLink group/user instead of groupId/userId

stbill79
Champ in-the-making
Champ in-the-making
Using the Rest API, I can retrieve both task IdentityLinks and HistoricIdentityLinks (and maybe process instance Identity links, though these appear to be from the task package).

Regardless, the pojo interfaces both use groupId and userId. Most of the Rest docs incorrectly show responses of groupId and userId also.

However, the RestIdentityLink has group and user attributes which ends up being marshalled to JSON. The HistoricIdentityLink uses groupId and userId, which I assume is correct since you'd want to follow the engine API models.

Is this a bug? I don't see anything in the Git history suggesting it was changed for one reason or another. The docs clearly show userId and groupId, though in a few cases user and group (in the processInstance IdentityLink responses). This is the 5.19 docs, though I'm using 5.20.

The master branch (5.21-SNAPSHOT) has not changed either.

Thanks,
Bill
2 REPLIES 2

jbarrez
Star Contributor
Star Contributor
Not sure if I'm following yet - do you mean this is an inconsistency or a documentation bug?
Can you post the json that is returned from the URLS you mention?

stbill79
Champ in-the-making
Champ in-the-making
For example, the documentation at http://www.activiti.org/userguide/#_get_all_identity_links_for_a_task shows a response of:

<javascript>
[
  {
    "userId" : "kermit",
    "groupId" : null,
    "type" : "candidate",
    "url" : "http://localhost:8081/activiti-rest/service/runtime/tasks/100/identitylinks/users/kermit/candidate"
  },
  {
    "userId" : null,
    "groupId" : "sales",
    "type" : "candidate",
    "url" : "http://localhost:8081/activiti-rest/service/runtime/tasks/100/identitylinks/groups/sales/candidate"
  },

  …
]
</javascript>

What you actually get:

<javascript>
[
  {
    "user" : "kermit",
    "group" : null,
    "type" : "candidate",
    "url" : "http://localhost:8081/activiti-rest/service/runtime/tasks/100/identitylinks/users/kermit/candidate"
  },
  {
    "user" : null,
    "group" : "sales",
    "type" : "candidate",
    "url" : "http://localhost:8081/activiti-rest/service/runtime/tasks/100/identitylinks/groups/sales/candidate"
  },

  …
]
</javascript>

I would think it should be userId and groupId as that is what the Java POJO interface uses.

In other words, the IdentityLink Pojo and the RestIdentityLink are not in sync. I patched it by just adding in the groupId and userId to RestIdentityLink.