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

Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X

ASPECT_ISLOGGED string is missing from .net SDK, but Java SDK has it.

rad1
12-Amethyst

ASPECT_ISLOGGED string is missing from .net SDK, but Java SDK has it.

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:

CSharpAndJavaLibraryAspect differences.jpg

ACCEPTED SOLUTION

Accepted Solutions
rad1
12-Amethyst
(To:rad1)

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.

View solution in original post

1 REPLY 1
rad1
12-Amethyst
(To:rad1)

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.

Announcements


Top Tags