#875 updating a record using Java

Mark Chidwick Tue 24 Nov 2020

I would like to update a tag on a "space" record using the Java framework. I have added a tag called "score" to the space record. I would like to be able to update that tag from Java.

I can get the spaceRef using the query "space and spaceNum=123". This returns the record for the space. I would then like to update a tag for that record.

I can see how to update a record in a historian:

HRef meterRef = HRef.make(id, name);
HHisItem[] values = new HHisItem[1];
values[0] = HHisItem.make(HDateTime.make(date.getTime()), HNum.make(value));
client.hisWrite(meterRef, values);

However, I would like to update a space record (not a historian).

Thanks for your help

Brian Frank Tue 24 Nov 2020

There is no standard HTTP op to perform that. So it will be based on the server implementation for how/if it supports it.

Mark Chidwick Tue 24 Nov 2020

Thanks for the input Brian.

I am using the java Haystack library provided by SkyFoundry. Its likely that they are using HTTP web service under the covers - in which case it is likely that this is not supported.

So in effect, the Haystack protocol is a query only standard. Disappointing.

Chris Breederveld Tue 24 Nov 2020

Hi Mark, as you are trying to do something that is not possible in the Haystack definitions, but is in SkySpark, your question is best asked there.

However I can say that you can do this using Axon using the eval call. If you have any questions on that, I suggest you continue this talk on their forum.

Mark Chidwick Wed 25 Nov 2020

Chris, Brian: Many thanks for your feedback. I will contact SkySpark for this question.

Login or Signup to reply.