Professional Documents
Culture Documents
Contents
1. Introduction 5. How Forms are Built in Bonita Open Solution
2. A Simple Process in Bonita Studio 6. Anatomy of a Form Presented in a Web App
3. Defining and Customizing the Fields of a Form 7. Defining the Global Page Template
4. Adding a Customized Confirmation When a 8. Defining the Template for the Web App
Form is Submitted 9. Conclusion
1. Introduction
Bonita Studio is used to graphically model a business process with BPMN notation and
generate a process-based application designed to automate this process. Bonita Studio’s
Whiteboard allows the process designer to draw the process flow graphically, and apply
connectors to connect the process to external information systems such as database, email,
calendar, LDAP, ERP and so on. Various forms of data can be defined to be input, acted
upon, passed along, and output throughout the process.
In addition, “human” steps in a process require interaction with an end user. This
interaction generally takes place through a web application composed of a set of forms
presented in a web browser, allowing process actors to perform the required tasks to
complete process cases.
The Web Application Builder in Bonita Studio allows the designer to create customized
forms for the end user. This white paper describes an example of how this can be done.
The Web Application Builder allows the user to create the list of variables accessible from a
step, and specify how they can be updated.
To illustrate how forms are built and customized, this paper will refer to a very simple
process example: New Employee Start.
In this process, the initiator is a newly hired employee who is returning a signed employment
contract. Thus there is a form presented via a Web interface which is completed by this new
employee.
In the first step, Human Resources receives the information, and adds the start date. In the
next step, another HR agent receives this information and then sends a letter to the
employee to indicate when he/she should report for their first working day.
Thus there are 3 forms needed: an initial form, a form for the step Receive new employee
and a form for the step Send confirmation/welcome letter.
Before forms can be created, the data for the process must be defined. In this process there
are 7 global variables and one local variable. Each variable name is followed by its type
(Attachment, a List of Options titled Department, Text, Date, and Boolean.)
At each step in a process where a person is involved (i.e. a Human Step in Bonita Open
Solution), Bonita Open Solution automatically creates a default Bonita Form with fields
based on the data variables defined. The Process designer can then customize these forms.
The Web Application Builder allows the designer to manipulate fields in the form of cells in
a grid. The data variables selected are presented first as a series of cells in a single vertical
column. Web Application Builder adds a Submit button at the bottom of the column.
The field cells can be re-arranged. Rows and columns can be added and deleted; cells can be
moved and merged.
The field labels can be customized, so the end user sees a descriptive label instead of the
variable name.
Forms can be previewed. This initial form, in Preview mode, shows which variables are
defined for which fields (this is not seen in the final version – see the difference between this
and Figure 18.)
• Label a field (static labels are shown in Figures 5 and 6, above). Labels can also be
dynamic, defined with variables that will be filled at runtime, by applying a
Groovy expression.
• Restrict the type of data a field will accept by applying a validator, as shown in
Figure 7 below).
Figure 7. A validator added to a field restricts the type of input it will accept
The designer can also apply the following, some of which are shown in the next figures.
These examples are from the second form in this process:
Figure 13. The Groovy editor is available in form fields (and for variable definition,
labels, validators, and more) to allow the use of dynamic expressions
Defining the variable or data that each field in a Form is to enter, process, or output is a
critical application of the Web Application Builder. Each field widget presents options
specific to each type of data field, and most allow the From designer to specify what
variables the field will accept, validate the type of input, choose a default value, and
manipulate that data in an expression (ie concatenate, apply operators, and so on). The
Figures above show an example of a text field that takes the variables
newEmployeeFirstName and newEmployeeLastName, concatenates them and
saves the result as a new variable newEmployeeName. (See Figure 19 and 20 which show
two different examples of a dynamic label in a form as it is presented to an end user).
Each field widget allows for some fine tuning the grids, and the appearance of cells, grids,
labels, and field contents.
More fields for any form can be added by drag-and-drop from the Web
Application Builder Palette at the left.
Fields added in this way can be configured in the same way as just
described.
< Figure 17. Drag-and-drop field widgets from
the Web Application Builder palette into Web Application Builder
Each of the above forms is a single page, but it is also easy to create multi-page forms in a
step. The figure below shows a two page form in the step Receive New Employee.
The first page looks like Figure 19, but instead of Submit, there is a Next Page button.
Each page of a multipage form has a Next Page and/or a Previous button. The last page has
the Submit button to complete the form. Buttons can be re-named.
A “confirmation page” is shown at the end of each user’s sequence of steps, that is, after the
last form for that user to complete – in a series of one or more steps – has been submitted.
The contents of this page can be easily modified. (Its look-and-feel can be further
customized as described in the following sections.)
The end user interface (form) can be designed and customized in the following ways:
• Customize the fields and contents of a Form for a step (in what order the fields are
presented, how the fields are labeled, the characteristics of the fields such as read-
only, image, text, and so on). This is described in Section 2.
• Further customize the layout of an step Form by modifying or replacing the Global
Page Template; and/or by modifying or replacing the html template for the individual
form; and/or
• Change the overall Process Template (Web application) in which all Forms appear.
When a process is run with no Form customization, the default Bonita Form contains all
variables in alphabetical order, presented in default Page and Process templates.
Figure 24. default Bonita Open Solution Form (uncustomized form in default page and Process templates)
At this stage, the user form is not very useful! Some customization will result in a form with
just the fields wanted with the appropriate options to complete or see them. More
customization will result in a form with the look-and-feel desired.
Each Form created for a Step has essentially 3 levels that define its look-and-feel. The
following illustrations show how those 3 levels come together.
The Figure below shows the Process Template around the Global Page Template.
Global
Page
Template
goes
here
• a black exterior frame with a link to open Bonita User Experience; and
• a grey-and-white interior frame with the Bonita Open Solution name and logo,
the name of the user (admin), a link to log out, the process name, and a message
at the bottom.
In the next Figure, the form data fields have been selected and customized as described in
Section 2, the Bonita Global Page Template has been applied, and all of this is presented in
the Process Template.
Step level
page
template
= Step
Form +
Global
Page
Template
The following sections describe how it is possible to further customize these templates.
When the fields of the Form(s) for a step are defined, a default page template is generated
by Bonita Open Solution and linked with an html file that directs how the Form is to be
displayed inside the Global Page Template.
This can be modified in Bonita Studio Web Application Builder. The Web Application Builder
permits the download of the default Page Template – the designer can save the generated
html file for modification and re-upload.
For each data field in the Form, the html file contains a <div id> with its name as the “id”.
(Validators, if used, also have <div id> with the data field name and “validator”.) All of these
must be included in any modified html code in order to display the form fields as desired.
The entire Form is displayed inside the Process level template where
<element ID=”bonita_form”>
</div>
is located.
The designer can save the generated html file for modification and re-upload.
A new Global Page Template can be created by re-uploading the modifed html file (in
Applications.)
The built-in, default template in which all Forms are presented is an html file called at the
Process level. Five built-in process templates are provided in Bonita Open Solution. Each
contains the bonita_form <div ID> which is filled with the appropriate form at runtime.
The designer can save the generated html file for modification and re-upload.
Figure 29. Upload a built-in html template for all process Forms
The default template chosen is “black.” The CSS and images it calls are located in Resources.
The Process Template can be entirely customized by embedding the Global page template
into another html file and uploading the resources it calls.
Recall that in the Process Template example in Part 1, the following dynamic elements are
shown:
ELEMENT ID Defines
Table 1. Some of the element IDs for forms defined at the Process level
Figure 30: Change the look and feel of end user forms presented in a Web application
8. Conclusion
Developers using Bonita Open Solution can customize all forms presented to end users using
the widget tools and interfaces available in Bonita Studio.
The Web Application Builder provides a graphical means to define data fields, configure
them, and lay them out in a grid. This grid is then deployed into a Global Page Template.
The Global page template is in turn deployed into a Process Template (Web application).
The HTML and CSS of both the Global Page Template and Process Template can be changed,
modified, or replaced from within Bonita Studio to change the look-and-feel of the forms
and the frames in which they are presented externally.
Total customization of forms allows the process owner to run Bonita Open Solution “behind
the scenes.” Developers enjoy the benefit of Bonita Studio’s power and simplicity, and the
end user enjoys the benefit of easy-to-use interaction.
About BonitaSoft
BonitaSoft is the leading provider of open source business process management (BPM) software.
Created in 2009 by the founders of Bonita project, BonitaSoft democratize the use of BPM in
companies of all sizes with an intuitive and powerful solution with an optimum cost. The Bonita
solution has been downloaded more than 370.000 times to date by companies and organizations
worldwide.
Sales inquiries : sales@bonitasoft.com | Partner inquiries : partners@bonitasoft.com