Open topic with navigation

TIBCO® Enterprise Administrator 2.4.2

# Defining References for Object Types with Interfaces

References allow users to navigate from one object to related objects. To model relationships other than membership, you can expose a method as a reference. That is, define a method that returns the set of related objects, and annotate it as a @TeaReference.

When defining the source object type using interface style, define references as explained in this task.

To model a member relationship, implement the WithMembers interface.

Procedure
1. Declare the method signature.
   The method cannot have any parameters, and it must return an array or java.util.Collection of objects that implement com.tibco.tea.agent.api.BaseTeaObject.
   For example, in TIBCO ActiveMatrix, administrators can distribute an application to a set of nodes. In the agent, the `getNodes()` method returns an array or java.util.Collection of those nodes. The `Node` class implements the BaseTeaObject interface.

        public Node[] getNodes(){
           ...
       }

       public Collection<Node> getNodes(){
       	...
       }

2. Annotate the method as a reference using @TeaReference.

       @TeaReference(name = "nodes")
       public Node[] getNodes(){
           ...
       }

       @TeaReference(name = "nodes")
       public Collection<Node> getNodes(){
           ...
       }

   If the reference type class defines more than one object type, then include the objectType attribute, to distinguish among them.

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO® Enterprise Administrator

Copyright © 1996-2025. Cloud Software Group, Inc. All Rights Reserved.