This limitation is documented in the ReST API Documentation
found here. That notes that this is a change from the behavior starting with 8.5.7 fix pack 2016-9. I know why they did it, even if there were other ways to solve the problem. The data below is based on my testing against previous versions of the product to understand how team filters etc. worked. Some of the theories about the technical specifics are my own and do not necessarily reflect the real code.
When Team Filter services first came out, if I remember correctly, there was a problem. If I used a team filter service 18 times, and it returned the same result "Andrew and Bernd" each time, we'd wind up with 18 groups in the DB, each having that membership. The efficiency of the query "Get all of Andrew's tasks" degrades as the number of groups I am in increases (or did back then). So a request was made "Please reuse the same team if the result of the filter is the same".
The above requirement worked, in that, if the team filter service returned the same membership, the previously created group was used. However it appears the the specifics of this was implemented using some sort of Hashing. At a guess I think it was some combination of the filter that was used and an ordered list of group members. The problem (I'm guessing) is that while this solved the requested case, being "Tricksy" in solving this meant there were use cases not considered.
Specifically in my testing, if we added Atanu to our group using the API, he would, as you expected, see the task that were previously only assigned to Andrew and Bernd. However, there are 2 odd cases here. I'm guess it is because the API calls did not update the Hash.
- If the team filter service is called and returns "Andrew, Bernd, Atanu" a new group will be created.
- If the team filter service returns "Andrew and Bernd" again, it will use the previous team , that now has Atanu in it, which isn't the right group based on the filter.
Rather than address these problems it seems like they simply removed the ability to get into that state, even though this causes the problem you have seen. One option for doing the reassignment would be as follows -
- Create a service flow.
- In the service flow, call the team filter service and get the team you want to assign the task to.
- Drag in an activity and set it to "Modify Task"
- Use the data from the team to provide the value required.
I left #4 as vague as the documentation for the widget says to use the "user or group name" and group names for filtered teams are really weird, so you might have to experiment a little.
If you need to do this from another system, surface this as an API for the use of that system.
I know it sucks that the functionality was changed without much fan fare, but hopefully the above helps you get the desired outcome.
------------------------------
Andrew Paier
------------------------------
Original Message:
Sent: Fri March 27, 2020 07:55 AM
From: Bernd Varga
Subject: Management/delete of ad hoc group
Hi all,
for some reason a wrong ad hoc group was created with no members instead of one member was created. Normally it works. If the same user request the same ad hoc group, the already existing group with no member is returned.
Now I have two questions:
1. How can it be, that such group was created? Below is the filter implementation:
tw.local.filteredTeam = tw.local.originalTeam;
tw.local.filteredTeam.name = "LOCAL";
tw.local.filteredTeam.members = new tw.object.listOf.String();
tw.local.filteredTeam.members[0] = tw.local.userId;
2. How can we delete or management it? Following request does not work anymore:
{{IBM_REST_URL}}/rest/bpm/wle/v1/group/{{groupId}}?action=addMember&user={{userKey}}
{
"status": "error",
"Data": {
"status": "error",
"exceptionType": "com.ibm.bpm.wle.api.GroupMembershipUpdateException",
"errorNumber": "CWTBG0633E",
"errorMessage": "CWTBG0633E: Updating the group membership failed for the following reason 'CWLLG3237E: Users and groups can neither be added nor deleted from an ad hoc group.'.",
"errorMessageParameters": [
"CWLLG3237E: Users and groups can neither be added nor deleted from an ad hoc group."
],
"responses": null,
"errorData": null
}
}
Thanks for any advice?
BR Bernd
------------------------------
Bernd Varga
------------------------------