Skip to content

Commit

Permalink
Update for Bonita 7.9.3
Browse files Browse the repository at this point in the history
This example has been upgrade to use the latest features available in Bonita 7.9.3.
Some workarounds have been removed as better alternatives exist in Bonita 7.9.
The content of the Git repository is now the Bonita project files. .bos file can be found in "releases" on GitHub.
  • Loading branch information
Antoine Mottier committed Sep 18, 2019
1 parent fb2b246 commit 579348f
Show file tree
Hide file tree
Showing 30 changed files with 6,517 additions and 12 deletions.
68 changes: 68 additions & 0 deletions .gitignore
@@ -0,0 +1,68 @@
# Output of source code compilation.
# For example Bonita includes helper Groovy classes such as BonitaUsers (with for example getProcessInstanceInitiator method).
# Sources (e.g. BonitaUsers.groovy) are located in src-providedGroovy folder and build result (e.g. BonitaUsers.class) is located in bin folder.
/bin

# BDM jar generated from the BDM definition (bom.xml)
/lib/bdm-client-pojo.jar

# You can also ignore in lib folder jar files related to connectors or actor filters provided by Bonita
/lib/bonita-connector-email-impl-1.0.15.jar
/lib/bonita-userfilter-initiator-impl-1.0.0-SNAPSHOT.jar


# Classpath configuration for Bonita Studio. Automatically generated.
.classpath

# Project settings. Studio is able to create them with appropriate default value if needed.
.settings

# Should be created by the Studio if needed.
/META-INF

# Should be created by the Studio if needed.
/build.properties

# If you don't use database connectors you can safely ignore the content of database_connectors_properties folder
/database_connectors_properties

# h2 database information are only used when testing application in Bonita Studio.
/h2_database

# ACME test organization is provided by Bonita Studio.
# You probably don't want to include it except if you did some customization.
/organizations/ACME.organization

# Ignore the Groovy script sources provided with Bonita Studio.
/src-providedGroovy

# Web component user individual preferences (e.g. bookmarked,...).
/web_widgets/.metadata
/web_page/.metadata

# Output of web component build
/web_widgets/*/*.js
/web_page/*/js

# Web widgets provided by Bonita in the UI Designer.
/web_widgets/pb*/

# Gradle (can be used for example to build and package REST API extensions).

# Ignore Gradle generated files.
.gradle
**/build/

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored).
!gradle-wrapper.jar

# IntelliJ (can be used for example to create a REST API extension).

# Ignore IntelliJ output folder.
**/out/

# IntelliJ user workspace configuration.
**/.idea/**/workspace.xml

# IntelliJ Gradle integration configuration.
**/.idea/**/gradle.xml
41 changes: 41 additions & 0 deletions .project
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>My project</name>
<comment>7.9.3</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.bonitasoft.studio.common.repository.bonitaNature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.groovy.core.groovyNature</nature>
</natures>
</projectDescription>
Binary file removed Procurement resources-1.4.bos
Binary file not shown.
22 changes: 10 additions & 12 deletions README.md
@@ -1,25 +1,23 @@
# Procurement Living Application

## About
This is an official Living Application example for Bonita BPM 7
This is an official Living Application example for Bonita 7.
It is build using Bonita 7.9.3 and is compatible with any future releases of Bonita 7.

This example demonstrates the following concepts:
- Living Application
- Forms, pages and custom widgets built the UI Designer
- Forms, pages and custom widgets built in the UI Designer
- Process using BDM and contracts

## Installation

1. Download the <a href="https://github.com/Bonitasoft-Community/procurement-example/releases">application bundle</a>
2. Extract the bundle to a temporary folder
3. Import the .bos file in your Bonita BPM Studio (it contains 3 processes: Procurement request, Init sample procurement data and Create supplier)
4. Deploy all 3 processes (click on Run in a Studio but do not complete the forms)
4. Run the sample data initialization process once and remove it from the Portal
6. Export the Procurement application, go to 'Development->Application Descriptor->Export', select Procurement_application.xml and click on Export.
7. Export the application pages, go to the UI Designer, click on the Export icon for the Pages 'procurementRequestListing' and 'supplierListing'.
8. In the Portal, as an administrator, go to 'Resources' and add the 2 custom pages .zip files. You can read more about custom pages <a href="http://documentation.bonitasoft.com/pages">here</a>.
9. In the Portal, go to 'Applications' and import the Procurement application.xml file. You can read more about applications <a href="http://documentation.bonitasoft.com/applications-0">here</a>.
10. Run the Procurement application by accessing to this url (the port number may vary):<br/><a href="http://localhost:8080/bonita/apps/procurement">http://localhost:8080/bonita/apps/procurement</a>
1. Download the <a href="https://github.com/Bonitasoft-Community/procurement-example/releases">project .bos file</a>
1. Import the .bos file in your Bonita Studio (it contains 3 processes: Procurement request, Init sample procurement data and Create supplier)
1. Deploy all 3 processes: select the process in the **project explorer**, do a right click and select **Deploy**
1. Run the sample data initialization process once and remove it from the Portal (using administration view)
1. Deploy the two application pages: in the **project explorer**, select **Pages/Forms/Layouts**, select a page, do a right click and select **Deploy**. Do the same for the second page. You can read more about pages from the <a href="https://documentation.bonitasoft.com/bonita/7.9/pages">official documentation</a>.
1. Deploy the application: in the **project explorer**, select **Application descriptors**, select _Procurement_application.xml_, do a right click and select **Deploy**. You can read more about applications in the <a href="https://documentation.bonitasoft.com/bonita/7.9/applications">official documentation</a>.
10. Run the Procurement application by accessing to this URL (the port number may vary):<br/><a href="http://localhost:8080/bonita/apps/procurement">http://localhost:8080/bonita/apps/procurement</a>


**Note:** this simplified version of the Procurement Request process only uses one actor.<br/>
Expand Down
20 changes: 20 additions & 0 deletions applications/Procurement_application.xml
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<applications xmlns="http://documentation.bonitasoft.com/application-xml-schema/1.0">
<application token="procurement" version="1.0" profile="User" homePage="requests" state="ACTIVATED" layout="custompage_defaultlayout" theme="custompage_bootstrapdefaulttheme">
<displayName>Procurement</displayName>
<description>This a procurement sample application.</description>
<iconPath></iconPath>
<applicationPages>
<applicationPage customPage="custompage_supplierListing" token="suppliers"/>
<applicationPage customPage="custompage_procurementRequestListing" token="requests"/>
</applicationPages>
<applicationMenus>
<applicationMenu applicationPage="requests">
<displayName>Requests</displayName>
</applicationMenu>
<applicationMenu applicationPage="suppliers">
<displayName>Suppliers</displayName>
</applicationMenu>
</applicationMenus>
</application>
</applications>
62 changes: 62 additions & 0 deletions bdm/bom.xml
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<businessObjectModel modelVersion="1.0" productVersion="7.2.0.beta-02">
<businessObjects>
<businessObject qualifiedName="com.company.model.Request">
<description>Procurement request</description>
<fields>
<field type="LONG" length="255" name="caseId" nullable="false" collection="false"/>
<field type="STRING" length="255" name="summary" nullable="true" collection="false"/>
<field type="STRING" length="512" name="description" nullable="true" collection="false"/>
<field type="LOCALDATE" length="255" name="creationDate" nullable="false" collection="false"/>
<field type="STRING" length="255" name="createdBy" nullable="false" collection="false"/>
<field type="STRING" length="255" name="status" nullable="false" collection="false"/>
<field type="LOCALDATE" length="255" name="completionDate" nullable="true" collection="false"/>
<relationField type="AGGREGATION" reference="com.company.model.Supplier" fetchType="EAGER" name="selectedSupplier" nullable="true" collection="false"/>
</fields>
<uniqueConstraints/>
<queries/>
<indexes/>
</businessObject>
<businessObject qualifiedName="com.company.model.Quotation">
<description>Quotation sent to suppliers based on a request</description>
<fields>
<relationField type="AGGREGATION" reference="com.company.model.Request" fetchType="EAGER" name="request" nullable="false" collection="false"/>
<relationField type="AGGREGATION" reference="com.company.model.Supplier" fetchType="EAGER" name="supplier" nullable="false" collection="false"/>
<field type="STRING" length="255" name="status" nullable="false" collection="false"/>
<field type="BOOLEAN" length="255" name="hasSupplierAccepted" nullable="true" collection="false"/>
<field type="DOUBLE" length="255" name="proposedPrice" nullable="true" collection="false"/>
<field type="STRING" length="255" name="comments" nullable="true" collection="false"/>
</fields>
<uniqueConstraints/>
<queries>
<query name="findFromRequest" content="SELECT q &#xA;FROM Quotation q &#xA;WHERE q.request.persistenceId = :id" returnType="java.util.List">
<queryParameters>
<queryParameter name="id" className="java.lang.Long"/>
</queryParameters>
</query>
</queries>
<indexes/>
</businessObject>
<businessObject qualifiedName="com.company.model.Supplier">
<fields>
<field type="STRING" length="255" name="name" nullable="false" collection="false"/>
<field type="STRING" length="255" name="description" nullable="true" collection="false"/>
</fields>
<uniqueConstraints>
<uniqueConstraint name="UNIQUE_NAME">
<fieldNames>
<fieldName>name</fieldName>
</fieldNames>
</uniqueConstraint>
</uniqueConstraints>
<queries>
<query name="findById" content="SELECT s &#xA;FROM Supplier s &#xA;WHERE s.persistenceId = :id" returnType="com.company.model.Supplier">
<queryParameters>
<queryParameter name="id" className="java.lang.Long"/>
</queryParameters>
</query>
</queries>
<indexes/>
</businessObject>
</businessObjects>
</businessObjectModel>

0 comments on commit 579348f

Please sign in to comment.