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

Made a template, added a service to it. Service is 'Dynamic' - why?

terry1
1-Newbie

Made a template, added a service to it. Service is 'Dynamic' - why?

I created a ThingTemplate, then added a service.


This service is 'Dynamic'. Why? How does ThingWorx determines whether or not a service is dynamic?

Are all user-defined services dynamic?

8 REPLIES 8
paic
1-Newbie
(To:terry1)

Hi Terry,


I'm not sure where you are seeing Dynamic, but any Services a user adds to a ThingTemplate will only execute at the Instance (Thing) level.

So it maybe referring to that. 

Within the Mashup building environment we use the Dynamic check box to be able to dynamically at runtime specify an instance based upon a given template and execute the services.  



terry1
1-Newbie
(To:paic)

"I'm not sure where you are seeing Dynamic, but any Services a user adds to a ThingTemplate will only execute at the Instance (Thing) level." - ok, then it being 'Dynamic in my Mashup building environment makes sense.


I made a simple function, for example getNumberPlusSix( number_in ) { var result = number_in + 6; }

This function doesn't need an entity/thing to function, so I thought... "why is this function only available under 'Dynamic' in the Mashup builder?" :)</span></div></p>

Was this ever resolved? I have similar issue.

Created service based on QueryImplementingThingsWithData to filter on an input parameter (SiteID).

This works correctly when tested.

However when I go to use this in my mashup (the mashup that originally used QueryImplementingThingsWithData) I see the newly created service it is a Dynamic service.

I am missing understanding on how to implement the same mashup now with a dynamic service.

Any pointers to documentation or example on how to implement a mashup with a dynamic service?


Thanks,

fmanniti
9-Granite
(To:paic)

Hi Pai Ching, I don't know if this is too OT, but I want to know if is there any chance to make a service which will execute to the template level.

I have all things which inherit the property from the thing template and I want to make a service which sets (by a input from mashup) a value to property for ALL the things. But I don't know how to do this

Hi Fabio,

Will be so good to have "static" methods at a ThingTemplate or ThingShape level, but there isn't

To "workaround" this, you should create a "Helper" Thing which implements the Static Code, for instance if you have a template called "Car" you can create a CarHelper Thing ( which doesn't inherits from Car" ) which implements the desired Static services.

Best Regards,

Carles.

So you mean that CarHelper is a Generic Thing and not a thing from Car template, isn't it?

Yup, that way you only have one instance of CarHelper will all "Static" Services for Car ThingTemplate.

Well name it whatever you want

Announcements