...
You will find a BPMN editor packaged along with the WSO2 EI tooling. This BPMN editor can be used to create a BPMN artifact easily.
- Start Eclipse EI Tooling and navigate to File → New → Other.
- Search or scroll and find the BPMN category under the WSO2 folder, click BPMN Project, and click Next.
- Enter a project name (e.g.,
LeaveProcessBPMN
) and click Next. - In the next window that appears, select any referenced projects and click Finish. You will now have a new BPMN project.
Click Open Perspective on the below message, which pops up.
Tip You will not get this message if you are already in the Activiti perspective. You can view the current perspective from the below tab.
...
- Right-click on your BPMN project found on the left pane of your Eclipse window in the Project Explorer and select New → Other.
- Search or scroll and find the BPMN category under the WSO2 folder, click BPMN Diagram, and click Next.
- Enter a file name (e.g.,
LeaveProcess.bpmn
) and select theBPMNProject/src/main/resources/diagrams
directory as the parent folder and click Next. Select a template diagram or create a new empty diagram and click Finish.
In the Project Explorer view, you view the BPMN diagram added under the project you specified and a new empty canvas will open up along with a Palette. You can use the palette to drag and drop artifact symbols to create the desired diagram.
Click anywhere on the canvas, and click Process in the Properties tab, to change the ID,name and namespace of the process, which will be created once you deploy the BPMN Project.
Press Ctrl+S to save both the BPMN Diagram and the BPMN Project you created.
Configuring the Start Event
To implement the leave approval process, drag a Start Event to the design canvas.
Tip Every BPMN process should start with a Start Event and end with an End Event.
- To implement the scenario, in which the employee submits a leave application form, click Form in the Properties tab of the Start Event.
To create the application form, click New and add a new entry for each of the following fields.
id Name Type Date Pattern Readable Writable Required numberOfDays Number of days long - true true true startDate First day of holiday (dd-MM-yyyy) string dd-MM-yyyy hh:mm true true true vacationReason Reason string - true true true employeeName Name of employee string - true true true - To add an admin user as the initiator of the process, enter
admin
as the value of the Initiator field in the Main Config section of the Properties tab. - Add an End Event to the diagram and connect the Start Event to it.
Anchor | ||||
---|---|---|---|---|
|
- Press Ctrl+S to save all the artifacts, which you created in WSO2 EI Tooling.
Right click on the name of the project in the Package Explorer window, and click Create deployment artifacts.
Tip If you do not have the Package Explorer view, click Window → Show View → Other, select Package Explorer and open it.
This creates the BAR file under the deployment folder of the project. This archive file contains of all the artifacts of your BPMN project for you to deploy it in the Business Process profile of WSO2 EI.
Deploying BPMN artifacts
After you create the deployable archive, follow the steps below to deploy them.
- Start the Business Process profile of WSO2 EI. For instructions see Starting the Business Process profile.
In a web browser, open the Management the Management Console of the Business Process profile, and log in with the default credentials (username: admin and password: admin).
Click Main → Manage → Processes → Add → BPMN, browse the BAR file of the BPMN Project and click Upload.
Tip If you are unable to locate the BAR file, right click on the name of the BAR file in the Package Explorer window and click Properties to find it as shown below.
Info If you upload a package with an existing name, the processes in the package gets versioned. This retires all the old processes in the package and deploys the new version. Since only package-level versioning is available, the new package will include all the processes defined in the old package, even though you may only need to update a single process in that package.
Once you uploaded the artifacts successfully you will view the new processes added to the list as shown below.
Tip If you do not view the new processes, refresh the browser or click Main → Manage → Processes → List → BPMN.
Expand title Undeploying a BPMN Project If you want to undeploy a BPMN Project, there are two ways of doing it as follows.
- From the Management Console of the Business Process profile:
- Log in to Management Console, click Main → Manage → Processes → List → BPMN.
- Click the Package Name you want to undeploy.
- The Package Dashboard page appears. Click on the Undeploy link.
- By deleting the BPMN ZIP file from the file system.
- Delete the BPMN package from
<EI_HOME>/wso2/business-process/repository/deployment/server/bpmn
directory.
- Delete the BPMN package from
Expand title Suspending process instances In the Management Console, click Main → Manage → Instances → BPMN to suspend a process instance that is created by a deployed process.
- From the Management Console of the Business Process profile:
Testing the output
Follow the steps below to test the output.
- Log in to the BPMN-explorer at https://localhost:9445/bpmn-explorer using
admin
for both the username and password. - Click PROCESSES in the top menu, and click the Start option of the Leave Approval Process.
Initiate the process by filling the form and click Start.
You view the following message.