Linking Across Two Products

You can allow the agent of one product to cross-link to an object contributed by another agent. For example, assuming that TIBCO ActiveMatrix and TIBCO Enterprise Message Service Agents are registered with the TIBCO Enterprise Administrator server, when looking at an TIBCO ActiveMatrix configuration, a TIBCO Enterprise Administrator operator can click the configured TIBCO Enterprise Message Service link and see the Enterprise Message Service management screens. In other words, TIBCO Enterprise Administrator operators can seamlessly access an asset by seamlessly traversing different products whose Agents are registered with the TIBCO Enterprise Administrator server.

You can achieve cross product linking using the teaObjectService.load javascript API (through customized User Interface from the agent code and TeaObjectHardLink API (TeaReference returning instances of TeaObjectHardLink object) provided by the TIBCO Enterprise Administrator Agent library. This will cause a link (to the object being linked to) to appear in the TIBCO Enterprise Administrator User Interface. If the agent whose object is being linked to is not registered or the object that is being linked to is unreachable, the link for the object will behave according to how you have customized it to behave in your Agent code.

The teaObjectService.isProductRegistered javascript API can be used to figure out if a particular product is registered with the TIBCO Enterprise Administrator server or not. This can be used to solve a use case where an agent wants to leverage an operation contributed by another product. If this product is not registered then the link for the object will behave according to how you have customized it to behave in your Agent code.

Prerequisites

The following procedure is an example that assumes that the Agents of both TIBCO ActiveMatrix and the TIBCO Enterprise Message Service are registered with the TIBCO Enterprise Administrator server.

Procedure

  1. Use the teaObjectService.load (in the agent code where you customize the TIBCO Enterprise Administrator User Interface) function to retrieve TeaObject to be linked by passing ObjectId. For example,
    teaObjectService.load(
    {agentId: "ems", agentType: "EMSAgent", objectType: "server", objectKey: "s1"}).then(function (object) 
    				{
          $scope.emsServer1.teaObject=object;
        },function (object) 
        {
          $scope.emsServer1.errorMessage=object.message;
        });
    
  2. Use the TeaObjectHardLink interface (java-side of TIBCO Enterprise Administrator Agent) to create the link (to the object being linked to) to appear in the TIBCO Enterprise Administrator User Interface. For example,
    @Customize("label:EMS Queues")
    	@TeaReference(name = "queues")
    	public BaseTeaObject[] getEmsQueues() {
    		final TeaObjectHardLink hl1 = new TeaObjectHardLink() {
    
    			@Override
    			public String getName() {
    				return "sample";
    			}
    
    			@Override
    			public String getDescription() {
    				return "Sample queue";
    			}
    
    			@Override
    			public String getObjectID() {
    				return "ems:EMSAgent::queue:s1%3Asample";
    			}
    		};
    		final TeaObjectHardLink hl2 = new TeaObjectHardLink() {
    
    			@Override
    			public String getName() {
    				return "doesNotExist";
    			}
    
    			@Override
    			public String getDescription() {
    				return "This queue does not exist";
    			}
    
    			@Override
    			public String getObjectID() {
    				return "ems:EMSAgent::queue:s1%3AdoesNotExist";
    			}
    		};
    		return new BaseTeaObject[] {hl1, hl2};
    	}
    
  3. Use the teaObjectService.isProductRegistered javascript API (in the agent code where you customize the TIBCO Enterprise Administrator User Interface) to figure out if the product is registered with the TIBCO Enterprise Administrator server or not. For example,
    teaObjectService.isProductRegistered(
    {agentTypeName: "EMSAgent", agentTypeVersion: "0.13"}).then(function (object) {
            $scope.emsProduct=true;
        }, function(object) {
           $scope.emsProduct=false;
    								...
    								...