Skip to main content
1-Visitor
May 31, 2017
Question

How do I invoke queryPropertyHistory Service of Remote Thing from Java SDK?

  • May 31, 2017
  • 2 replies
  • 2488 views

Hi,

I have a Virtual Thing defined in Java SDK. The corresponding remote thing in platform has valuestream associated with it. I am writing a custom service in virtual thing which needs to invoke the queryPropertyHistory Service so that i can query the value stream with query parameters. Can any one help me to achieve this?

Thanks,

Azim

2 replies

20-Turquoise
May 31, 2017

Please refer to the edge helpcenter for documentation/guides: PTC

5-Regular Member
June 1, 2017

Hi azim hawaldar​,

Have you tried with following:

InfoTable result = client.invokeService(entityType, entityName, service, parameters, timeout);

Example:

InfoTable result = client.invokeService(ThingworxEntityTypes.Things, "Thing_Name_Here", "QueryPropertyHistory", params, 5000);

I hope it helps.

ahawaldar1-VisitorAuthor
1-Visitor
June 1, 2017

Hello Ankit Gupta​,

I need to send query parameters like startDate, endDate, oldestFirst and query. So how can I send these params ? startDate, endDate and oldestFirst seems to be easy as these are first level object, the query param is bit complex since its an jsonObject. Appreciate your help if u can give me example as above with param.


Thanks,

Azim

5-Regular Member
June 2, 2017

Hi azim hawaldar​,

I haven't tried Query in the Java Extension.

But per my understanding; we have create a Filter first and then we can convert it to Query jsonObject.

Do let me know if you face any issue; I will try to implement it.