objectAPI
The objectAPI provides services that perform BPM-related functionality. The API is provided in the form of a JavaScript library. It supports both JavaScript and AngularJS.
Each objectAPI service performs a specific type of BPM functionality. For instance, the AuditService provides functions for managing audit information, the WorkListService is used to display and manage work lists, and so on. For a list of all available objectAPI services, see objectAPI Reference.
Internally, the objectAPI services invoke the ActiveMatrix BPM REST API. Some services return JavaScript objects corresponding to the returned JSON value.
Invoking the objectAPI
To invoke the objectAPI, you must include the following libraries:
<script type="text/javascript" src="/apps/app-cdn/tcf/tcf.nocache.js"></script>
<script src="/apps/app-cdn/angular/1.7.5/angular.min.js"></script>
The tcf.nocache.js library contains the underlying logic used by the objectAPI. The Angular library is needed even if you are using pure JavaScript.
If you are using JQuery in your application, you must also include the following library:
<script type="text/javascript" src="/apps/app-cdn/jquery/jquery-3.3.1.js"></script>
The single point of entry for all objectAPI services is the RestApiService object.
In AngularJS, it can be injected as a service named RestApiService.
A function in the service is executed as follows:
RestApiService.getWorkListService().getWorkListItemsForGlobalData(...)
All request objects are in the package:
tibco.objectapi.service.request
All functions are asynchronous and have a callback object:
var request= … var callback=… RestApiService.getWorkListService().getWorkListItemsForGlobalData(request,new callback())
Example of using the objectAPI -- getting a work list
- Get access to the service for work lists:
RestApiService.getWorkListService ( )
- Create a request object:
var request = new tibco.objectapi.service.request.GetWorkListItemsRequest ("RESOURCE", " tibco-admin", 0, 100);
- Create a response callback:
var callback = function(deferred) { this.onSuccess = function(result) { // success you got worklistResponse var workitems=result.workItems; }, this.onFailure = function(message) { //handle failure }; };
- Make the service call:
RestApiService.getWorkListService().getWorkListItems(request, new callback());