Skip to main content
16-Pearl
February 21, 2020
Solved

Prefix in name of entities

  • February 21, 2020
  • 11 replies
  • 4142 views

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

Best answer by AdamM.Levine

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

11 replies

raluca_edu
17-Peridot
February 21, 2020

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

Gucio16-PearlAuthor
16-Pearl
February 21, 2020

hi,

 

for sure it's possible because as far as I remember during PTC course it was established. Question: how??

thx

13-Aquamarine
March 6, 2020

Put the following code into your service:

 

var username = Resources["CurrentSessionInfo"].GetCurrentUser();

 

-->Adam