Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X
Experts, I was working on a code for fetching WTGroups and I saw some strange values being returned by the code. On checking the DB I saw weird group names in the database as well. These groups are not present in the UI. Any idea what these are? I also wrote a query builder report to query all WTGroups. It also returns the same.
Solved! Go to Solution.
These are deleted groups. When a group is deleted from Windchill, most of the DB entries related to the group are deleted. However, Windchill keeps the entry in the WTGroup table, but makes two modifications to it. First, the name of the group is updated to be '{wt.org.WTGroup:<idA2A2>}<Name>'. Then, the value of the 'disabled' column is set to 1. The same is also done when users and orgs are deleted.
Whenever Windchill does any query for users/groups/orgs, the query always includes the predicate 'disabled=0', so that only valid groups are returned. If you want your code to ignore these groups, then you should modify it to only query for groups with a value of 0 in the disabled column.
These are the groups created either for at site or at Org or container level, which are not visible to users But required as part of the System. you can ignore them.
Hi Sudhakar,
Thanks for your prompt reply. I am developing a utility to replace one user with the another in All WTGroups when he leaves the Organization. If what you say is true then I Will have to replace the user in those groups as well. As, when I query all groups for that user these groups are returned as well and I assume I Will have to replace the user in those groups as well. Correct me if I am wrong.
Thanks.
Praveen
Hi Praveen,
I don't think there will be users in those groups. I had developed a utility like that in past. we need to replace the user other than those groups. If you have Project link you need to replace in project template also.
Regards
Sudhakar
These are deleted groups. When a group is deleted from Windchill, most of the DB entries related to the group are deleted. However, Windchill keeps the entry in the WTGroup table, but makes two modifications to it. First, the name of the group is updated to be '{wt.org.WTGroup:<idA2A2>}<Name>'. Then, the value of the 'disabled' column is set to 1. The same is also done when users and orgs are deleted.
Whenever Windchill does any query for users/groups/orgs, the query always includes the predicate 'disabled=0', so that only valid groups are returned. If you want your code to ignore these groups, then you should modify it to only query for groups with a value of 0 in the disabled column.
To avoid disabled groups in your results , you can append following search condition to QuerySpec in your customization:
qs.appendWhere(new SearchCondition(WTGroup.class, WTGroup.DISABLED,SearchCondition.IS_FALSE )