Hi,
I have 2 Questions?
Question 1:
ASPECT_ISLOGGED string is missing from .net SDK. Why? Any way we can still create it on the agent side?
I am using this code on Thingworx agent to add a property
PropertyDefinition propertyDef = new PropertyDefinition("MyPropertyName", "Description", GetType()); AspectCollection aspects = new AspectCollection(); bool isReadOnly = true aspects.Add(Aspects.ASPECT_ISREADONLY, new BooleanPrimitive(isReadOnly)); propertyDef.setAspects(aspects);
I am trying to add "logged" aspect
In Java Sdk I can see static strings defined as:
public final class Aspects { public static final String ASPECT_ISREADONLY = "isReadOnly"; public static final String ASPECT_ISLOGGED = "isLogged";
While in C# I can these aspects are defined only as empty strings. I am not sure if that is true as this is decompiled code.
public class Aspects { public static readonly string ASPECT_ISREADONLY;
Can I still use isLogged aspect in C# and use string literal: "isLogged" instead of referencing "missing
ASPECT_ISLOGGED aspect from C# SDK:
bool isLogged = true
aspects.Add("isLogged", new BooleanPrimitive(isLogged));
Question 2.
I have additionaly question about the structuro ofJSON structure remoteBindingAspects property
used as params for Thing/ThingTemplate method AddPropertyDefinition(parms)
How to find out what is the correct structure of this object?
Comparison on Aspects class:
Solved! Go to Solution.
For others who are wondering this line in Thingworx agent works
bool isLogged = true
aspects.Add("isLogged", new BooleanPrimitive(isLogged));
Aspects.ASPECT_ISLOGGED static field should be added to C# library and it is definitively an omission.
I still don't know what goes inside remoteBindingAspects JSON object.
For others who are wondering this line in Thingworx agent works
bool isLogged = true
aspects.Add("isLogged", new BooleanPrimitive(isLogged));
Aspects.ASPECT_ISLOGGED static field should be added to C# library and it is definitively an omission.
I still don't know what goes inside remoteBindingAspects JSON object.