Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

SA_find_user is not returning a status error for invalid user argument

Siemens Pioneer Siemens Pioneer
Siemens Pioneer

code

=======================================================================

status = SA_find_user("bogus user", &source_tag);
printf(" \n status *************************************** is [%i] \n",  status);

=======================================================================

 

output

=====================

*************************************** is 0

=====================

 

Also happens with -

 

code

====================

chat *item_target_value = "bogus";

printf(" \n *************************************** CHECKING USER for item_target_value [%s]\n", item_target_value);
status = SA_find_user(item_target_value, &source_tag);

printf(" \n status *************************************** is [%i] \n",  status);

=====================

 

ouput

=============

*************************************** CHECKING USER for item_target_value [bogus]

status *************************************** is [0]

=============

 

where 'bogus' is not a user in my Teamcenter db.

 

I would expect a status error(non 0) to be returned.

 

Appreciate any thoughts about this.

 

Thanks,

Roy

 

2 REPLIES

Re: SA_find_user is not returning a status error for invalid user argument

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

You need to add a check that the return value source_tag != NULLTAG.

That's how the function is designed. Please see the documentation: https://docs.plm.automation.siemens.com/data_services/resources/tc/12.1/tcrefs/custom/en_US/ITKFunct...

 

 

Finds a user with the specified user_id. The user_id is unique in the database. 
If user_id does not exist, user will be NULLTAG.

 

 

Re: SA_find_user is not returning a status error for invalid user argument

Siemens Pioneer Siemens Pioneer
Siemens Pioneer

Yes,  after I posted this,  I found sample code that indicated a nulltag was the check point.