hi all,
is it possible to setup thingworx in that way that all entities created by user will have some prefix in name? I have in ming something similar to OIR in Windchill.
thx in advance
Solved! Go to Solution.
Oh, that feature. A bit of a warning - it's a hidden and unsupported feature that was added to the product specifically to address use cases unique to PTC's training environment. This is an environment where hundreds of student-developers follow an exercise, creating entities with the same name and features. The _username was added to avoid naming conflicts. We did not conceive of customers having a need for this.
That said, you can turn this feature on in [tomcat_root]/webapps/Thingworx/config/buildConfig.json.
Add the following to the json file:
"enableEntityUserNameSuffix":true
That will turn on the feature. However, be aware that this feature is quite limited - it only appends _username to entities created using ThingWorx Composer. If you create your entities programmatically using services or import them, the suffix will not be added.
It is also obnoxious when creating users. Most organizations like usernames to be email addresses, and the feature will append _username to the email address... president@whithouse.gov_president is not a good username.
-->Adam
Hi,
Out of the box solution for that is not available.
Probably a custom setup can be done, but I do not have any idea.
Regards,
Raluca Edu
hi,
for sure it's possible because as far as I remember during PTC course it was established. Question: how??
thx
Put the following code into your service:
var username = Resources["CurrentSessionInfo"].GetCurrentUser();
-->Adam
@AdamM.Levine - looks and works ok when service is executed - thanks.
But iI wanted to setup thx in that way that after user types name in UI, in background some postfix will be added.
I remember that and was also wondering how that works. E. g. if I created an entity called "HelloTestTemplate" it automatically appended the user name and the actual entity name became "HelloTestTemplate_bbeuckSIG".
Oh, that feature. A bit of a warning - it's a hidden and unsupported feature that was added to the product specifically to address use cases unique to PTC's training environment. This is an environment where hundreds of student-developers follow an exercise, creating entities with the same name and features. The _username was added to avoid naming conflicts. We did not conceive of customers having a need for this.
That said, you can turn this feature on in [tomcat_root]/webapps/Thingworx/config/buildConfig.json.
Add the following to the json file:
"enableEntityUserNameSuffix":true
That will turn on the feature. However, be aware that this feature is quite limited - it only appends _username to entities created using ThingWorx Composer. If you create your entities programmatically using services or import them, the suffix will not be added.
It is also obnoxious when creating users. Most organizations like usernames to be email addresses, and the feature will append _username to the email address... president@whithouse.gov_president is not a good username.
-->Adam
thanks for your answer and deep explanation, but unfortunately in my test environment it is not working.
Maybe in my version it is deprecated and isn't working at all.
My buildConfig.json looks as follow:
{
"copyright": "Copyright \u00a9 2019 PTC Inc. and/or Its Subsidiary Companies. All rights reserved",
"helpCenterLink": "http://support.ptc.com/help/thingworx_hc/thingworx_8_hc/",
"productName": "ThingWorx",
"theme": "twx-default",
"version": "8.5.3-b123",
"enableEntityUserNameSuffix":true
}
regards
One thing I forgot to mention. It doesn't append the username if you are the Administrator user. That could be it.
-->Adam
Bingo - all the time I did test as administrator. As a "normal" user - your solution works perfectly. It is what I was looking for.
Thanks, @AdamM.Levine I really appreciate your knowledge & time.