Process automation developer tooling
Install on CodeReady Containers
Ensure you have installed OpenShift with CodeReady Containers Easy Install
-
Run 'init.sh' or 'init.bat' file. 'init.bat' must be run with Administrative privileges.
Log in to the HR Rewards project to start exploring an online employee rewards application (the address will be generated by the init script):
- CodeReady Container example: http://insecure-rewards-rhpamcentr-appdev-in-cloud.apps-crc.testing ( u:erics / p:redhatpam1! )
Want to build the Rewards demo from scratch? Try this hands-on online workshop.
Running the rewards process
-
Click on the "rewards" project to open the project.
-
The project has a data model (Award and Employee), task forms, and a rewards approval process.
-
There are two EMAIL tasks configured to send email (for the linked workshop), but we want to mock them off to instead log the email to the server we deploy to. To do this go to the rewards project SETTINGS -> DEPLOYMENT -> WORK ITEM HANDLERS where you'll see an EMAIL task entry. Change the entries by replacing them with the folowing below and click on SAVE button:
Name: Email Value: new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler() Resolver type: MVEL
-
Build and deploy version 1 of the project. Click on the "Build and Deploy" in the upper right corner.
-
Go to "Menu -> Deploy -> Execution Servers" repository to see the rewards_1.0.0 Kie Container deployed on the Process Automation Server.
-
Go to "Menu -> Manage -> Process Definitions" to see the rewards-approval process version 1.0 has been deployed.
-
Click on the process definition line, then start a New Process Instance with button in the top right corner.
-
Fill in the Employee Reward form as follows and click on Submit button:
Name: Eric D. Schabell Department: IT Award amount: 100 Explanation: Good work on demo
-
Go to "Menu -> Manage -> Process Instances" and select the process instance listed as running that you just started. This give the options to look at Instance Details, Process Variables, Documents, Logs, and Diagrams. Let's look at where this process is right now by selecting the Diagrams tab.
-
The red box around the "Approve Reward" task means we need to decide if the employee is to receive the award or not, so go to the "Menu -> Manage -> Tasks" and selecting the waiting task.
-
Click on "Claim" button at the bottom followed by clicking on the "Start" task button (standards-based user task completion steps mandate these phase labels for tasks) to edit the provided task form field. There is only one field to edit, so check the Approval box (you can leave blank to reject an award).
-
After submitting the form by clicking on the "Complete" button go to "Menu -> Manage -> Process Instances" and in the filters panel on the left put a check-box in the "Completed" field to view completed process instances. Find your just completed process instance, select it from the list, and open the "Diagram" tab to view the greyed out boxes that depict the path taken through this process. You should see that this employee reward has completed in the "End Accepted" final end node of the process.
-
To see the Email task results you can use the 'oc get pods' command to find the 'rewards-kieserver-#-#####' and then view the logs to see the email was sent using the mocked logging feature from above, something like this (your pod number will be different:
$ oc get pods NAME READY STATUS RESTARTS AGE business-automation-operator-7ddc5869c8-m655d 1/1 Running 0 34m console-cr-form 2/2 Running 0 33m rewards-kieserver-1-deploy 0/1 Completed 0 33m rewards-kieserver-1-f77k7 1/1 Running 0 19m rewards-rhpamcentr-1-deploy 0/1 Completed 0 33m rewards-rhpamcentr-1-tmvvp 1/1 Running 0 33m $ oc logs rewards-kieserver-1-f77k7 13:52:52,653 INFO [stdout] (default task-5) Executing work item WorkItem 6 [name=Email, state=0, processInstanceId=3, parameters{From=hr@company.com, To=Eric D. Schabell@company.com, TaskName=Email, Body=We are happy to inform you that your reward submission was approved and will soon be deposited to your bank account!, Subject=Your reward was approved!}]