cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Create missing Things via 404's

m_Sheridan
6-Contributor

Create missing Things via 404's

Hi,

 

Is it possible to create Things in response to 404's?

 

For example, a new machine turns on for the first time and begins sending data to

.../Thingworx/Things/exampleMachine/Services/exampleService

 

Normally if the Thing hasnt been created this just returns a 404 but is there a way to use the 404 as a trigger for creating the missing entity.

 

Any advice is appreciated.

 

5 REPLIES 5
PaiChung
22-Sapphire I
(To:m_Sheridan)

First of all as a best practice we recommend either pre-creation of entities or at least a validation to establish that contact from a piece of equipment is valid and is truly an entity that should be created.

 

Not sure how much logic you can put into your new machine itself, but usually it would first send a registration call which then will update the necessary information in the platform as well as the machine as necessary before starting regular communication.

 

You can check the different logs and see if the error shows up in the logs, if not the ThingWorx logs, potentially the Tomcat logs, so you could scrub those periodically to then trigger the entity creation.

m_Sheridan
6-Contributor
(To:PaiChung)

Hey PaiChung,

 

I appreciate the best practices advice but unfortunately the solution I am looking for is to help with older machines and it wouldnt be practical to update their code as they are in the field.

 

I did also check the thingworx logs but seen nothing... I will look into the tomcat logs.

 

Thanks.

Martin.

PaiChung
22-Sapphire I
(To:m_Sheridan)

Would anything prevent you from having users pre-register equipment that they are going to connect or create it ahead of time?

As pai said you could take advantage of logs because am getting entity not found being logged in Application Logs.
https://www.ptc.com/en/support/article/CS207699
and you could query logs and create actions based on that

GuruPrasad1_0-1641537477505.png

 

PaiChung
22-Sapphire I
(To:GuruPrasad1)

It sounds like this won't work because the actual 'link' doesn't exist, so the call never makes it into ThingWorx, it should however show up in the Tomcat logs somewhere I think.

Announcements


Top Tags