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

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Notification on new Thing created?

VinayVaidya
11-Garnet

Notification on new Thing created?

Is there any way to get notified when new things are created?

8 REPLIES 8
PaiChung
22-Sapphire I
(To:VinayVaidya)

You could have an event / subscription on the ThingStart event

Thank you Pai, I am having problems finding documentation on replication, can you point me in the right direction?

ThingStart event is when an existing thing starts. The question is about addition of new things runtime. The thing is not on hand to create subscription on.

Hi Vinay,

New Things will be created by Composer or by a Custom Mashup? if it's a custom Mashup, should be easy to wrap Resources["EntityServices"].CreateThing(params) service into a custom one and throw a Custom "CreateThing" event.

Carles.

It might be created by any means, that is external to the system. At best, there can be knowledge about what ThingTemplate or ThingShape it might inherit.

Another Option can be something like this:

  • Create a Timer that's executed every 1minute ( or the frequency you want )
  • Create a Special Tag on a Vocabulary: "ThingCreated"
  • A subscription to this timer, which:
    • Queries all the things that doesn't have "ThingCreated" tag
    • Add That Tag to the thing
    • Throw the custom event "ThingCreated" for that thing.

Sure, that can be done and is being considered. Just wanted to find out if there is an elegant way to do it by receiving notification instead.

PaiChung
22-Sapphire I
(To:VinayVaidya)

I like what Carles suggests, at some point in time something runs to create the new Thing, wrap it into there.

With ThingStart, I didn't want to go too deep, but add a boolean with default of FALSE that toggles to TRUE after your notification routine is done.

Put the code into a ThingShape that is always part of your ThingTemplate.

And this way you can use ThingStart to get notification.

Now for notification you can set up email, text, some log entry etc. (wasn't sure if you were wondering about how to do notification as well)

Top Tags