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

Can we get datatable values from thingworx to java with Edge SDK without service

SOLVED
Highlighted
Newbie

Can we get datatable values from thingworx to java with Edge SDK without service

i have java code in which i have connected to thingworx through appkey and i want to access data table values without service is it possible to retrive values without services?

Tags (2)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

Hi Kedar Borkar​, It is not possible to read Data from DataTable without a Service. There are inbuilt Services in ThingWorx Platform to read and write entries from/to DataTable.

View solution in original post

12 REPLIES 12
Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

Hi Kedar, you could test this by making a REST call from your Java code - though that will also use the service from the DataTable to get the values. Have you already tried that? Else any reason why you don't want to create a service for this? Any specific use case?

Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

I will try with that no specific use case just want to know whether it is possible or not.

Thanks

Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

Hi Kedar Borkar​, It is not possible to read Data from DataTable without a Service. There are inbuilt Services in ThingWorx Platform to read and write entries from/to DataTable.

View solution in original post

Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

Okay i will try with invoking Services for reading and writing entries.

Thanks

Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

I have tried calling service for getDataTableEntries and updateDataTableEntries and i am able to get and set values through java edge sdk.

Thanks for immidiate responses.

Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

Hi Kedar,

Can you tell me how you are writing services in java sdk? even i want to fetech the data entered from platform to java SDK.

Thank you.

Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

Hi Geetha D,

Sure. Actually we have created services in datatable's service tab in thingworx.

And we are using that services to get and set values through java.

below is the example by which you can call thingworx services from java.

client.invokeService(ThingworxEntityTypes.Things, "datatable1", "SetPingStatusDataTableEntries", value, 5000);

let me know if you still facing issue with that.

Thanks.

Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

Hi Kedar,

Thank you for your response.

client.invokeService(ThingworxEntityTypes.Things, "datatable1", "SetPingStatusDataTableEntries", value, 5000); in this what it means "datatable1" "SetPingStatusDataTableEntries"?

and my requirement is I have created one mashup having textbox and button. when i enter some value in textbox  and hit button, that value i should get in JavaSDK.

If you have any idea can you please tell me the steps ASAP.

Thank you.

Geetha

Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

Hi Kedar,

Do you have any idea about how to call services from java SDK?

My requirement is I have created one mashup having textbox and button. when i enter some value in textbox  and hit button, that value i should get in JavaSDK.

Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

A quick question on your requirement:

After you click button why you need value in javaSDK?

I have not tried scenario like this, we have just set and get the values from data table and displayed it in thingworx through a java program logic.

And though if that is the requirement, i think you need to first save that value in data table through service and then you need to fetch from there. but i am not sure whether this will work for you or not. I don't have that much hands-on on thingworx.


May be Ankit Gupta​ can help you...

Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

Thank you for your response.

if you piece of java code to get and set the data , Can you share with me?

Highlighted

Re: Can we get datatable values from thingworx to java with Edge SDK without service

Hi Geetha D,

hi you can call service from java code once you have connected as below:

ValueCollection value = new ValueCollection();

value.SetStringValue("Status", status);

value.SetStringValue("RaspberryPiName", result.getRow(i).getStringValue("RaspberryPiName"));

client.invokeService(ThingworxEntityTypes.Things, "datatable1", "SetPingStatusDataTableEntries", value, 5000);

you need to create a value collection for input parameters and output parameters based on the service.

if you want to set value you need to create a input parameters and to get value you need to create a service with output parameters.

and to fetch value you can use below code:

ValueCollection params = new ValueCollection();

  params.put("maxItems", new IntegerPrimitive());

  //To read all the values from the Data table of Thingworx with service getDataTableEntries

  result = client.invokeService(ThingworxEntityTypes.Things, "datatable1", "getDataTableEntries", params, 5000);

Hope this will be helpful.

Thanks.

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum!