ngBonita
WARNING: this project is no longer maintained.
Table of Content
- About
- Installation
- Download
- Dependencies
- Build instructions
- Examples
- Basic example with authentication
- Business Data example
- Resource Documentation
AngularJS module for Bonita BPM platform. This module acts as a Bonita REST API client. It allows to quickly build business application by providing user management API, authentication API, business process API, ...
Notes:
- this module is not an official extension of Bonita BPM
- this module is compatible with Bonita BPM 6.0 and onward but some resources may be missing in early Bonita versions
The project binaries are available here
In order to use ngBonita, you will need the following JS dependencies:
- Angular core 1.3.0 or upper
- Angular resource module
If you wish to build the project from the sources, follow these instructions:
- Make sure you have installed grunt. See this guide for more instructions.
- Open a command line at the project root directory
- Run "npm install"
- Run "grunt build"
A new release should always start with a fresh build :
grunt
That will guarantee that the dist folder is up-to-date.
This project use grunt-release for its release process. To release a new version, you simply have to use one of these grunt-release process, depending on the version you want to set :
grunt release
grunt release:minor
grunt release:major
If you're afraid to try it directly, you can see what it will do with a dry run, using one of these :
grunt release --no-write
grunt release:minor --no-write
grunt release:major --no-write
The following example will log in Bonita with user "walter.bates" and will list the process definitions that he has the right to start using the browser's console:
var app = angular.module('appMainModule', ['ngBonita']);
app.config(function (bonitaConfigProvider) {
// Optional call to override Bonita URL setup
bonitaConfigProvider.setBonitaUrl('http://localhost:8080/bonita');
});
// Application controller
app.controller('AppController', function($scope, $log, bonitaAuthentication, ProcessDefinition){
// Logs into Bonita as 'walter.bates'
bonitaAuthentication.login('walter.bates','bpm').then(function() {
// Lists all process definitions that can be started by current user
ProcessDefinition.getStartableByCurrentUser().$promise.then(function (processDefinitions) {
$log.log('Listing '+ processDefinitions.items.length +' process definition(s):');
for (var i=0; i<processDefinitions.items.length; i++)
$log.log(' - '+ processDefinitions.items[i].name +' '+ processDefinitions.items[i].version);
// Logs out of Bonita
bonitaAuthentication.logout();
});
});
});
The following example will retrieve BDM objects of type com.company.model.Supplier
using a find
query.
Note that the authentication part is ommited in this sample and be sure to add the BusinessData
dependency in your controller.
BusinessData.getDataQuery({businessDataType:'com.company.model.Supplier', q:'find'}).$promise.then(function (data) {
$log.log('Listing '+ data.items.length +' Supplier BDM(s):');
$log.log(data.items);
});
As of latest version, the following resources are available:
- ArchivedCaseDocument
- ArchivedHumanTask
- ArchivedProcessInstance
- BonitaSession
- CaseDocument
- HumanTask
- ProcessDefinition
- ProcessInstance
- User
Starting form ngBonita 1.6 a new BusinessData
resource is avalailable to query BDMs.
Each call to this resource requires a mandatory parameter businessDataType
with the fully qualified Java class of the BDM object.