Lab 7 - Running rewards process

Lab Goal

To build, deploy, and complete rewards process including task forms for approving an employee rewards submission

Running rewards process

Time to run our new rewards process by submitting ourselves for a reward, evaluating this award as the HR department in the user task, submit that decision in the form provided, and verify that the personnel file got updated and that we are notified of the results with an email.

First what about email?

  • We have an email task, but no local SMTP mail server?
  • Another problem, email tasks need configuration at project level
  • Let's start with configuring the email task handling in the project
  • This is done with a Work Item Handler (WIH), nothing more than the code behind a task
  • We'll use an email WIH that sends to local SMTP server on port 25
  • Open the project assets view with Menu -> Projects -> (click on) rewards -> Settings

Email work item handler

  • Select in menus: Deployments -> Work item handlers
  • In right pane click on: + Add Work Item Handler

Email work item handler

  • Fill in the following fields:
  • Name: Email
  • Value: new org.jbpm.process.workitem.email.EmailWorkItemHandler("localhost", "25", "", "", "true")
  • Click to save on the far left SAVE button

A local SMTP server

  • Mail is now inbound on port 25, we need a server to listen
  • We've included on at ./support/fakeSMTP.jar
  • Launch form console with java -jar support/fakeSMTP.jar
  • It captures emails on port 25 after clickoing on Start Server

Building Rewards Project

  • Are you ready to build the rewards project?
  • From project assets view, click on top right BUILD button
  • If all goes well you'll see a green pop-up verifying the build

Deploying Rewards Project

  • Now let's deploy the project
  • Click on top right DEPLOY button
  • If deployed previously, a pop-up appears asking if you want to replace the existing build artifact
  • Click OVERRIDE to replace the build artifact

Deploying Rewards Project

  • If all goes well you'll see a green pop-ups verifying the deployment
  • Note that deploying also triggers a build

Examine Process Definition

  • Let's take a look at the process definition deployment
  • Select via top Menu -> Manage -> Process Definitions

Examine Process Definition

  • This opens the Manage view pane where you'll see our Rewards definition
  • Later you can use the drop-down menu at the top to jump between different views
  • We're going to open the Rewards definition by clicking on it

Starting a Process Instance

  • This view offers choice of definition details or image of the process
  • Clicking on button: New Process Instance to start process instance

Start Process Form

  • You'll see your designed start form pop-up, add input data and click on SUBMIT

Process Instance Details

  • A green pop-up displayed the process id, now note the Current Activities
  • Select the Diagram tab for visual status of process

Open Task Inbox

  • Note the process instance is waiting at the user task, let's open our task inbox to view it
  • Open task inbox from Menu -> Track -> Task inbox

View Task Approve Reward

  • Remember you assigned Approve Reward tasks to the group Manager
  • Our user is a manager so the task Approve Reward waits on us
  • Note the filter at the top applied to show READY, IN PROGRESS, RESERVED status tasks only

Claim Task Approve Reward

  • Click on Approve Reward task to open
  • Note that it's waiting for first status of a user task, so click on CLAIM to take ownership

Start Task Approve Reward

  • The task is now ready for the next stage, so click on START to being the task and make the form editable

Complete Approve Reward

  • Approve the task (or reject), check (or not) the box Approve
  • Then submit task by clicking on COMPLETE

Remove Task Filters

  • The task is no longer in the inbox, it's due to the filter at the top
  • Click the filter line to remove, note the Approve Reward task is now green and completed

Review Process Instance

  • If all went well our process instance is completed, so let's check
  • Open the instance with Menu -> Manage -> Process Instance
  • Our instance is not in the list, due to filter, so remove State: Active by clicking

Review Process Instance

  • Click on the rewards process instance to open

Completed Process Instance

  • After opening, select the DIAGRAM tab to view complete process visual status
  • We see there should be a message in the logs simluating a personnel file entry for reward approval
  • We also see there should be an approval email waiting for us

Log Approval Verification

  • To verify the logging task, we try the LOGGING tab, but it's business level logging

Log Approval Verification

  • Let's check the server logs, back in the console used to start from:
  • We see there the entire run of our process including the logging and email sent messages
  • Let's go see what our fakeSMTP server has captured for us

Email Approval Verification

  • Check fakeSMTP server, it's indeed holding an approval email

Lab Sub-Goal

To view and explore available process and task reports

View Process Reports

  • Data gathering from processes and tasks can be found in Reports
  • First open Menu -> Track -> Process Reports
  • Initial process reports lack data, explore now for reference

View Task Reports

  • Now open Menu -> Track -> Task Reports
  • Initial reports lack data, explore now for reference
  • Feel free to start and complete more process instances

Rewards process project

(coming soon... new requirements leads to next evolution of the reward process project...)
Eric D. Schabell
Global Technology Evangelist and Portfolio Architect Director
@ericschabell
http://schabell.org
Other Red Hat Process Automation Manager Workshops

Red Hat Process Automation Manager Articles

Red Hat Process Automation Manager Demos

Process Automation Manager

Up next...

The end, or is it?

(stay tuned...)