Skip to main content
1-Visitor
September 4, 2020
Solved

Access a Network from the Java Eclipse SDK

  • September 4, 2020
  • 1 reply
  • 1138 views

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!

Best answer by Raccone

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

Raccone1-VisitorAuthorAnswer
1-Visitor
September 4, 2020

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);