Skip to main content
Sep 4, 2020 11:05 AM UTC
Solved

Access a Network from the Java Eclipse SDK

Dear devs,

 

I am struggling finding the way to access a Network using the Java Eclipse SDK: I have a service with a Thing, which is correctly assigned by the context, and I can access the list of the Networks in which the Thing belongs using:

 

 

thingNetworks = apiWrapper.GetNetworks();

 

 

 

Which returns an InfoTable with name and description of the network. I don't understand how can I use it to access the corresponding Network in the SDK, since based on the docs it only has an empty constructor associated to it.  

 

Thanks and best regards!

RacconeAnswer
Sep 4, 2020 12:55 PM UTC

I answered myself, there is a generic utility to find all entities by name: 

 

thingsNetwork = (Network) EntityUtilities.findEntityDirect(thingNetworks.getRow(0).getStringValue("name"), ThingworxRelationshipTypes.Network);

 

1 reply

RacconeAuthorAnswer
Sep 4, 2020 12:55 PM UTC

I answered myself, there is a generic utility to find all entities by name: 

 

thingsNetwork = (Network) EntityUtilities.findEntityDirect(thingNetworks.getRow(0).getStringValue("name"), ThingworxRelationshipTypes.Network);