java.lang.Exception: Invalid Global Session Parameter [null]
Hi,
1. I created 2 properties in GlobalSessionProperties ThingShape.
2. From Thingworx composer, I go to CurrentSessionInfo Resource.
3. I select the service 'GetGlobalSessionValues' and execute it. It displays the 2 properties and their default values.
4. Next I select 'SetGlobalSessionStringValue' and execute it with one of the properties created in step 1 giving a different value. It successfully executes.
5. I select the service 'GetGlobalSessionValues' and execute it. It displays the updated properties.
Now I go into my Authenticator extension and execute the same steps from 2 - 4, it throws "java.lang.Exception: Invalid Global Session Parameter [null]" at step 4. Here are the details:
Step 2) Resource sessionInfo = (Resource) EntityUtilities.findEntity("CurrentSessionInfo", ThingworxRelationshipTypes.Resource);
Step 3) InfoTable sessionShape = sessionInfo.processServiceRequest("GetGlobalSessionValues", null);
printInfoTable(sessionShape); // Convenience method to print ValueCollection.
This does not print the 2 properties I create.
Step 4) Set the value
ValueCollection params = new ValueCollection();
params.SetStringValue("Property1", value);
sessionInfo.processServiceRequest("SetGlobalSessionStringValue", params);
The above line throws "java.lang.Exception: Invalid Global Session Parameter [null]".
Any pointers appreciated.
Thanks
Pavan

