Thank you for the reply.
Neither. I was expecting the built-in data change occurrence when a value is changed to happen. It does fire and log the value to the value stream to be found under QueryPropertyHistory when I change it manually in the system, but when the property value is updated using the REST API it changes the value but does not get stored in the value stream.
It seems to be a permission error. It works fine if I change the Application Key I use to have Administrative access instead of limited access to only change the one thing.
I assume there are some visibility permissions I have to set on one of the subsystems or resources to get it to function properly.
Does anybody have any idea which one it is? I have tried:
- Platform subsystem
- Logging subsystem
to no avail.
I do have the visibility, design time as well as runtime permissions set up on the thing instance, not on the Generic template thing template it is derived from, but I do not think it is necessary because it is one instantiation of the specific thing I am working with. (To make sure it is not the issue I just gave all of the visibility and design time and run time permissions to specific user on all of the templates and things and it did not make a difference).
Without the proper permissions on the thing I do not think the property can be updated from the REST API which it is doing. It just do not pick up a value change to write it to the value stream or fire a subscription on data change.
I have set the visibility and permissions on the subsystems and the resources to include the specific limited rights user that the application key use, still getting the same error message with no event triggered. So it doesn's even look like the issue is there.
I am out of other possible ideas for the moment, do you perhaps have some? I do not think it is an option to give the remote device reporting the data Administrative privileges.
(just a quick description of my setup: at the moment I have a test Thing set up inheriting from the GenericThing template, I have a value stream assigned to the thing and all the relevant visibilities and permissions for runtime and design time set. I have two properties (a test value being changed (logged) via PUT request and a boolean property changing with a subscription on data change of the test property). The value for test property is updated with the API and I can see the value change, but subscription is not fired and the logged test property is not logged to value stream when the application key has reduced permissions, but when the application key has Administrative privileges it works without an issue)
Your help is appreciated.
I assume the error message you posted is from the Application log, but if you are observing the data change issue by checking the execution of a subscription, you should see more information in the script log each time a subscription script execution is attempted. Can you send a copy of the script log as well as a screen shot of the runtime permissions of the Thing entity?
It seems like the data change event is not firing because the user does not have permission to add the logged properties to the value stream. With stack tracing enabled in the logging subsystem, you will see an error like this.
com.thingworx.webservices.context.HttpExecutionContext@5fc32268] java.lang.NullPointerException: null
This can be corrected by adding the organization that your user belongs to to the visibility permissions of the Thingworx persistence provider. To update this, from the persistence provider list, select "advanced" and check "Show System Objects" to display the ThingWorxPersistenceProvider. Add your organization in the visibility section and save.