Skip to main content
1-Visitor
August 30, 2015
Question

Java Based ThingsShape

  • August 30, 2015
  • 1 reply
  • 3013 views

Hi

I am trying to create a sophisticated Java based ThingShape, which contains several services.

In one of those services, i would like to read the value of one of the properties,

which were defined in the ThingShape, and were received their value from the implemented Thing.

The only workaround i was able to find, is to use ThreadLocalContext.getMeContext() inside the service,

which return the Thing which implements that ThingsShape, and which fire the ThingShape's service,

and then iterate over it's properties.

Can you please confirm that this is the Bast practice for getting the Thing which call the ThingShape's service?

Thank you

Ido

1 reply

1-Visitor
March 14, 2016

I'd also be interested to know if this is the recommended method.

1-Visitor
March 15, 2016

Hi

The best I can say is that I received code for an example ThingShape from PTC Tech Support which used that technique to get the Thing.

Regards

Ian

1-Visitor
March 15, 2016

Thanks, Ian. I am going to give this a try.Any chance you could share the ThingShape sample from PTC?