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

Notification on new Thing created?

Highlighted
Garnet

Notification on new Thing created?

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

Tags (1)
8 REPLIES 8

Re: Notification on new Thing created?

You could have an event / subscription on the ThingStart event

Re: Notification on new Thing created?

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

Re: Notification on new Thing created?

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.

Re: Notification on new Thing created?

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.

Re: Notification on new Thing created?

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.

Re: Notification on new Thing created?

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.

Re: Notification on new Thing created?

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.

Re: Notification on new Thing created?

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)