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

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

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

ahawaldar
1-Newbie

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

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

4 REPLIES 4
posipova
20-Turquoise
(To:ahawaldar)

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

ankigupta
5-Regular Member
(To:ahawaldar)

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.

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

ankigupta
5-Regular Member
(To:ahawaldar)

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.

Top Tags