API documentation

exception pybonita.exception.BonitaException(err_info=None)[source]

Base class for exception raised in this package

exception pybonita.exception.BonitaServerNotInitializedError(err_info=None)[source]

BonitaServer has not been initialized prior to any action

exception pybonita.exception.ServerNotReachableError(err_info=None)[source]

Bonita server is not reachable

exception pybonita.exception.UnexpectedResponseError(err_info=None)[source]

Response from Bonita server is unexpected

exception pybonita.exception.BonitaHTTPError(bonita_exception='', code='', message='')[source]

Bonita HTTP Error.

Bonita Server always return a 500 error code, with a body containing XML with real HTTP error code and message (RFC are only made for dogs & cats)

This class embed the HTTP Error code, a message, and the Java exception class provided by the Bonita server.

class pybonita.user.BonitaUser(username, password, membership=None, role=None, group=None, **kwargs)[source]

A class to map a user in Bonita.

classmethod get_user(**kwargs)[source]

Retrieve a User with given parameter

Parameter can be any of : - username - uuid

Raises TypeError:
 if call with unknown parameter
Returns:BonitaUser instance or None if not found
classmethod get_user_by_username(username)[source]

Retrieve a User with the username

Parameters:username (str) – the username of the user to retrieve
classmethod get_user_by_uuid(uuid)[source]

Retrieve a User with the UUID

Parameters:uuid (str) – the UUID of the user to retrieve
set_delegee(user)[source]

Define the Delegee of a user

Parameters:user (BonitaUser) – the delegee to set with
Raises ValueError:
 delegee user is unknown in BonitaServer
set_manager(user)[source]

Define the Manager of a user

Parameters:user (BonitaUser) – the manager to set with
Raises ValueError:
 manager user is unknown in BonitaServer
class pybonita.user.BonitaGroup(name, label, description, parent=None)[source]

A class to map a group in Bonita.

classmethod get_default_root_group()[source]

Retrieve BonitaGroup which is the root, currently the /platform group.

Returns:BonitaGroup for /platform
classmethod get_group(**kwargs)[source]

Retrieve a Group with given parameter

Parameter can be any of : - path - uuid

Raises TypeError:
 if call with unknown parameter
Returns:BonitaGroup instance or None if not found
classmethod get_group_by_path(path)[source]

Retrieve a Group with the path

Parameters:path (str) – the path of the group to retrieve
classmethod get_group_by_uuid(uuid)[source]

Retrieve a Group with the UUID

Parameters:uuid (str) – the UUID of the group to retrieve
class pybonita.user.BonitaRole(name)[source]

A class to map a role in Bonita.

classmethod getRoleByName(name)[source]

Retrieve a role given a name

class pybonita.user.BonitaMembership(uuid)[source]

A class to map a membership in Bonita.

classmethod getMembershipByRoleAndGroup(role, group)[source]

Retrieve a membership given a role and a group

Parameters:
  • role (BonitaRole) –
  • group (BonitaGroup) –
Raises Exception:
 

if role or group is unknwo on server

TODO Return None or Raise exception if no membership found ?

class pybonita.server.BonitaServer[source]

Singleton object to declare Bonita server to be used

BonitaServer is a singleton object used by all BonitaObject within the pybonita package.

You can’t instanciate BonitaServer. To get the unique BonitaServer instance please use the static get_instance method.

classmethod get_instance()[source]

Returns the singleton instance of BonitaServer

Upon its first call, it creates a new instance of the BonitaServer implementation class On all subsequent calls, the already created instance is returned.

classmethod use(host, port, login, password, charsets=[])[source]

Set the connexion params to the BonitaServer

Returns the unique BonitaServer instance

Parameters:
  • host (str) – Bonita REST API server host
  • port (int) – Bonita REST API server port
  • login (str) – Bonita REST request credential login
  • password (str) – Bonita REST request credential password
  • charsets (list of str) – List of charsets the Bonita Server could use for answering