In the previous chapter, you updated the process definition for a new vacation request to add escalations. The Tahiti application definition does not yet meet all the requirements described in “Example Application: Vacation Management”, but it is complete enough that you can build and test a first version.
This chapter explains how to convert the Tahiti application page prototype into the real page that uses real data. Then you can build the Tahiti application with links from the application page to the relevant process tasks.
These are the stages in building the application:
You will carry out these stages in the development environment and validate the application.
In the development environment, you deploy a process by running it from Bonita BPM Studio. You can check that the process is deployed and is operating correctly by running it from the Bonita BPM Portal.
To deploy and check the Tahiti-NewVacationRequest process, follow these steps:
The new vacation request process is now ready to be called from the application page.
In “Create the Application Prototype” you created a prototype of the vacation statement application page. This section explains how to create the real application page. For now this will not include active buttons to modify or cancel a vacation request, because you have not yet defined the processes to handle those options.
Follow these steps:
session
with the following value: ../API/system/session/1
{{session.user_name}}
.processCreate
with the following value:../API/bpm/process?s=New Vacation Request&p=0&c=10&o=version&f=activationState=ENABLED
.Add a new JavaScript expression variable called urlStartCreateProcess
with the following value:
// Return the URL to the new vacation request process
// instantiation form
if
(
$data
.
processCreate
&&
$data
.
processCreate
.
length
>
0
)
{
return
"/bonita/portal/resource/process/"
+
$data
.
processCreate
[
$data
.
processCreate
.
length
-
1
].
name
+
"/"
+
$data
.
processCreate
[
$data
.
processCreate
.
length
-
1
].
version
+
"/content/?id="
+
$data
.
processCreate
[
$data
.
processCreate
.
length
-
1
].
id
;
}
else
{
return
null
;
}
myVacation
: change the type to External API and set the value to:../API/bdm/businessData/com.company.model.VacationRequest?q=findByRequesterBonitaBPMId&p=0&c=100&f=requesterBonitaBPMId={{session.user_id}}
myVacationAvailable
: change the type to External API, with the following value: ../API/bdm/businessData/com.company.model.VacationAvailable?q=findByBonitaBPMId&p=0&c=1&f=bonitaBPMId={{session.user_id}}
managerTeamInfo
: change the type to External API, with the following value: ../API/extension/vacationRequest
These variables are already used in the relevant widgets, so you do not need to change the widget Value properties.
The selectedRow
, teamSelectedRow
, copySelectedRow
, and hideCancel
variables do not need to be changed.
The managerTeamInfo
variable contains a combination of business data and organization data, which is retrieved using the REST API extension that you have downloaded. The extension needs to be deployed, as described in the next section.
Bind the Target URL property of the Create new vacation request Link widget to the variable urlStartCreateProcess
: click the icon and type the variable name.
In the Team vacation container, Vacation requests tab, bind the Target URL property of the Review selected vacation request Link widget to the following value: '/bonita/portal/form/taskInstance/' + teamSelectedRow.taskId
Replace the placeholder Text widget that contains the text IMAGE with a real image, as follows:
Preview the TahitiVacationManagement page to check that there are no errors. You will see data in some of the widgets but not all. This is normal when the application processes are not running.
Export the page using the Export button located next to the Save button. This will create a file called page-TahitiVacationManagement.zip.
An application consists of pages, navigation, and processes.
Before you begin, if you have not already done so, export the page from the UI Designer as you did in the previous section, and deploy the processes as you did earlier in the chapter. If you are creating an application for a deployment in a production system, you need to build the processes in Bonita BPM Studio and export them as a .bar file for deployment. In this chapter, however, you are creating a test application in development, so you can deploy the processes by running them from the Studio.
By default, when you exit from Bonita BPM Studio, the Bonita BPM database is reset and you lose any resource and application definitions. To avoid this, go to the Studio Preferences Database section and uncheck all the options. This only applies to the development environment when you start the Portal and the Bonita BPM platform from the Studio.
To create the Tahiti application, follow these steps:
Deploy the Tahiti REST API extension that you downloaded (see “Downloads”), as follows:
../apps/
, so you just need to specify the unique part, for example tahiti
.You have now created the Tahiti application. If you need to change any of this information, click the edit icon for the application in the application list then click More.
The next step after creating the application is to add the page. Follow these steps:
custompage_
.custompage_TahitiVacationManagement
.../apps/tahiti/
, is already displayed. Enter a unique term to identify the page in the application. The Tahiti application only has this page so you can call it index
.You have created the application and defined its content. The next section explains how to test it.
In the previous section, you created the Tahiti vacation management application. You have done some testing along the way to make sure that the individual components work, but now it’s time to test the whole application. This section outlines a test scenario that will validate almost every aspect of the application and the processes it contains.
There are three users in this scenario:
April and Walter are not managers. All three users have the same password, bpm
.
In this scenario, you need to use the Tahiti application as each user in turn, so you log in and log out several times using Bonita BPM Portal. In a production system, you would probably access the application from your corporate intranet, which would handle the login and you would not use Bonita BPM Portal.
The three users log in to the Portal with the User profile, and then access the Tahiti application using the browser bookmark that you created earlier. Each user has ten days of vacation available. To simplify checking, create all vacation requests for one day.
Follow these steps:
april.sanchez/bpm
) and then open the bookmarked Tahiti page in your browser.At the end of these steps, Helen’s vacation statement should show that she has 9 days available with one pending request, April has 9 days available with one pending request, and Walter has 8 days available with one pending request.
You have created the Tahiti vacation management application for submitting and approving new vacation requests, and validated that it works correctly in the development environment. The next chapter explains how to create the processes for modifying and cancelling a request, and how to update the application to include these options.
52.15.147.20